I have a custom provider in next-auth (last.fm). the user already is being sent to the authorization URL and can autherize the application there. Last.fm then sends the user back to the callback URL (in this case localhost:3000/api/auth/callback/lastfm with a token in the query. how can I access this token in the query to request a session token?
{
id: "lastfm",
name:"Last.fm",
authorization: LfmauthUrl, // Useres Autheries the App, Provider returns token
type: 'oauth',
version: "2.0",
clientId: process.env.LASTFM_API_KEY,
token: {
// url: "https://example.com/oauth/token",
async request(context) { // I thougt that the token maybe could be in the context here. Couldnt find it tho
console.log(context)
await makeTokenRequest(context)
}
}
}
All I really need is the token returned from last.fm after teh autherization
Thanks for any help!