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

add skipAssertUserNotAuthenticated option to signInWithRedirect #12584

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

dehli
Copy link

@dehli dehli commented Nov 17, 2023

Description of changes

This PR allows you to call signInWithRedirect even when a user is already signed in. The use-case is that we have Google login and some customers want to enforce that their users only sign-in with Google. If a user logs in with their password we will show an error along with a button prompting them to sign-in via Google. With v5, you could call Auth.federatedSignIn even when a user was already logged in. This allows you to similarly call signInWithRedirect.

I'm 50/50 on the name, might want to do the inverse so a truthy value would allow you to skip the assertion.
Edit: Decided to do the inverse instead.

Description of how you validated changes

Used patch-package with these changes.

Checklist

  • PR description included
  • yarn test passes
    • I'm getting 4 failures that are unrelated to my changes.
  • Tests are changed or added
    • Added placeholders for the time being since the function itself only has placeholders. Figured I'd submit the PR without them first.
  • Relevant documentation is changed or added (and PR referenced)
    • Is adding comments to interface all that's needed?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dehli dehli requested a review from a team as a code owner November 17, 2023 11:57
@dehli dehli force-pushed the main branch 3 times, most recently from d8523d4 to 1350a3b Compare November 17, 2023 12:38
@dehli dehli changed the title add assertUserNotAuthenticated option to signInWithRedirect add skipAssertUserNotAuthenticated option to signInWithRedirect Nov 17, 2023
@cwomack
Copy link
Contributor

cwomack commented Feb 20, 2024

Hey, @dehli 👋. We appreciate you opening this PR and will review it internally and reach out if there's further questions or suggestions.

@cwomack cwomack added the Auth Related to Auth components/category label Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auth Related to Auth components/category external-contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants