Skip to content

Commit

Permalink
try spotify fix
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lvax committed Oct 23, 2024
1 parent 203e5d7 commit d3ea3c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/utils/spotify/refreshSpotifyToken.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { SPOTIFY_ID, SPOTIFY_SECRET } from '$env/static/private';
import { SPOTIFY_ID } from '$env/static/private';

export const refreshSpotifyToken = async (refreshToken: string) => {
const response = await fetch('https://accounts.spotify.com/api/token', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: `Basic ${Buffer.from(`${SPOTIFY_ID}:${SPOTIFY_SECRET}`).toString('base64')}`
'Content-Type': 'application/x-www-form-urlencoded'
},
body: new URLSearchParams({
grant_type: 'refresh_token',
refresh_token: refreshToken
refresh_token: refreshToken,
client_id: SPOTIFY_ID
})
});

Expand Down

0 comments on commit d3ea3c6

Please sign in to comment.