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

feat: add skipBrowserRedirect option to signInWithOAuth #575

Merged
merged 1 commit into from
Jan 23, 2023

Conversation

hf
Copy link
Contributor

@hf hf commented Dec 30, 2022

Allows for custom handling of the redirect URL when in browser environments.

Fixes: #417

@@ -343,6 +343,7 @@ export default class GoTrueClient {
redirectTo: credentials.options?.redirectTo,
scopes: credentials.options?.scopes,
queryParams: credentials.options?.queryParams,
skipBrowserRedirect: credentials.options?.skipBrowserRedirect,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might be slightly confusing for some because some might interpret the "redirect" here as the redirect after the oauth flow has completed when we're actually referring to the redirect to the oauth provider's page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah let's merge this next year (hehe) to see if I can come up with a better name.

Copy link
Contributor

@j4w8n j4w8n Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the objective here is to eventually sign the user in via oauth, but not yet? And that the dev is now responsible for triggering the oauth provider url, which is returned.

Other possibilities:
delayProviderSignIn
enableMiddleware - if that's why this option is being introduced
autoAuthorization - would need a default of true
autoProviderSignIn - would need a default of true
autoSignIn - would need a default of true. might be more scalable if you ever wanted to introduce similar behavior for other sign-in methods.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume the objective here is to eventually sign the user in via oauth, but not yet?

Yup, the purpose is to return the oauth provider's URL so the developer can decide how they want to redirect the user to the site. I'd also prefer for the naming to be more explicit such that it encompasses the meaning of the oauth provider URL being returned.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification.

I'd also prefer for the naming to be more explicit such that it encompasses the meaning of the oauth provider URL being returned.

I'm having trouble coming up with verbiage to express this - especially since the URL is returned no matter what.

@hf hf force-pushed the hf/add-skip-browser-redirect-oauth-option branch from 44b8dfa to 9112e8c Compare January 23, 2023 09:55
@hf
Copy link
Contributor Author

hf commented Jan 23, 2023

I don't think we came up with any better name, so I'll merge it.

@hf hf merged commit 11a0fbc into master Jan 23, 2023
@hf hf deleted the hf/add-skip-browser-redirect-oauth-option branch January 23, 2023 10:06
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

output of oAuth signin in v2
3 participants