Back

Missing ProviderAccessToken in session object after successful OAuth2 login

  • 0
  • Self Hosted
  • Auth
  • Web
evandro_vv
21 Aug, 2024, 20:37

I'm having trouble retrieving the ProviderAccessToken no matter which provider I use it always returns an empty string.

auth.get.ts

TypeScript
      OAuthProvider.Google,
     '${url}/auth/${OAuthProvider.Google}/callback',
      '${url}/register',
      ["profile", "email"]
    );

    return sendRedirect(event, redirectUrl);```
> callback.get.ts

 `const session = await account.createSession(userId, secret);`

Can anyone shed a light on this please?
TL;DR
Developers are experiencing issues retrieving the ProviderAccessToken in the session object after successful OAuth2 login. The access token always comes back as an empty string regardless of the provider used. One possible solution is to check the configurations for obtaining the access token in the specified endpoints.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more