arctic: [BUG] spotify.validateAuthorizationCode(code) return Error 405: Method Not Allowed
I followed the docs to implement Spotify OAuth with Arctic and Multiple OAuth providers with Lucia and when using the spotify.validateAuthorizationCode(code)
function to get the tokens, I have a 405 error Method Not Allowed
I used the code from the Spotify documentation and it works:
const response = await fetch('https://accounts.spotify.com/api/token', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: `Basic ${VITE_BASIC_TOKEN}`
},
body: new URLSearchParams({
code: code || '',
redirect_uri: `${VITE_BASE_URL}/login/spotify/callback`,
grant_type: 'authorization_code',
code_verifier: storedState || '',
client_id: VITE_SPOTIFY_CLIENT_ID
})
});
const tokens = await response.json();
About this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 21 (9 by maintainers)
Oh nice catch, I’m using Bun too, first project I am using it, and haven’t thought about that possibility. Maybe it’s a bit too soon to try bun on projects even after 1.0 then 😅.