Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: add redirectUrl field in OAuth2AuthConfig for authWithOAuth2 #2581

Closed
Nikhil1920 opened this issue May 26, 2023 · 4 comments

Comments

@Nikhil1920
Copy link

In the new Simplified OAuth2 authentication flow(#55) there is no option to specify a custom redirect url after the flow is completed

this will be useful in apps where deep linking is setup and pocketbase backend is hosted on a different url

@ganigeorgiev
Copy link
Member

ganigeorgiev commented May 26, 2023

This doesn't make much sense to me. The idea of the "all-in-one" call is to handle everything in the user app without redirect (you can redirect to your custom url manually after await-ing the authWithOAuth2Request to complete).

If you want to provide a custom redirect url and to handle a deeplink, you can use directly the "Manual code exchange" flow, aka. the "old" way (internally the "all-in-one" call is using it).

@einarpersson
Copy link

If I have

  1. a SvelteKit application (using Pocketbase) on mydomain.com (vercel)
  2. a PB instance running on https://mypbinstance.fly.dev (fly.io)

does this men that I cannot use the Simplified OAuth2 authentication flow. Is that correct, or have I misunderstood?

@ganigeorgiev
Copy link
Member

ganigeorgiev commented Aug 16, 2023

@einarpersson The "all-in-one" OAuth2 flow works only in environments where you can open a browser window (eg. in a client-side browser, cli, desktop application, etc.).

It won't work in a node server-side context (unless you proxy it somehow) because it requires a long running persistent HTTP connection to remain active during the entire OAuth2 signin/signup process.

@Nikhil1920
Copy link
Author

@einarpersson it will work in your mentioned scenario the problem I had with it in my use case was that my svelte app is running in an android app so the user is not being automatically redirected to my app after authentication flow is completed just a go back message was being displayed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants