Back

Minor issue with setting up OAuth2Session

  • 0
  • Web
Chirag Aggarwal
13 Nov, 2024, 19:25

When creating a session via OAuth in appwrite, we can pass 3 parameters - the OAuth provider, success url and the error url.

When no urls are passed, it just redirected to this endpoint: https://cloud.appwrite.io/console/auth/oauth2/success?project=672e4a9d002a1304....

So i passed the success url as /dashboard since thats where i wanted it to go, but it required a complete url.

But that would require me to hardcode that value, although i want the logic to work regardless i am working on localhost, production, or preview-urls

For now i got the logic working via an environment variable, but is there a better way to perform this operation?

TL;DR
Developers are having an issue setting up OAuth2Session due to the requirement of passing a complete URL for success redirection. The current workaround is using an environment variable for flexibility across different environments.
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