https://supertokens.com/ logo
saving access token of social provider
k

Kevinkevinkevin

05/26/2023, 3:19 PM
@rp Hi , I was going through the documentation for getting the third party providers access token. Right now only when I login , I am getting the access token. But what if I need the access token later? How will be able to do that? override : { apis: (originalImplementation) => { return { ...originalImplementation, signInUpPOST: async function (input) { if (originalImplementation.signInUpPOST === undefined) { throw Error("Should never come here"); } let response = await originalImplementation.signInUpPOST(input) if (response.status === "OK") { let accessToken = response.authCodeResponse.access_token console.log(response) } return response; }, } } } https://supertokens.com/docs/thirdparty/post-login/getting-provider-access-token
r

rp

05/26/2023, 3:56 PM
hey @Kevinkevinkevin you could save it in the session's access token payload, or in the user metadata recipe, or in your own database.
k

Kevinkevinkevin

05/26/2023, 3:57 PM
Thanks @rp I implemented saving to database. I just wanted to know , if there were anything I missed.
r

rp

05/26/2023, 3:57 PM
right. Yea, at the moment, no other way.