-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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(auth): [EMAIL MFA] Sign In / Confirm Sign In With MFA_SETUP #13760
feat(auth): [EMAIL MFA] Sign In / Confirm Sign In With MFA_SETUP #13760
Conversation
a852083
to
eeb8249
Compare
fff1814
to
9d0989d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together.
Keeping track of state at 2 different places can be problematic. It introduces complexity when debugging, refactoring, and scaling. It can also lead to bugs. My concern is that when adding resumable-sign-in, the new store would also need to store state in sessionStorage.
To avoid all of that, we can keep handling the same state that is managed by the signInStore
and keep the sign-in flow between the getSignInResult
and handleChallengeName
helpers. If we want to add some extra state, we can add some metadata
in the signInStore — I don't see the need but I'll leave it up to you.
Bellow I added a flow diagram that shows the sign-in flow between the handleChangeName
and getSignInResult
helpers when challengeName is MFA_SETUP
7b30970
to
eee2523
Compare
eee2523
to
33a98c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough testing. Can we also add test cases for confirmSignIn MFA_SETUP challenge negative path cases
? — Making sure confirmSignIn
is still callable when an invalid response is passed in.
16b351a
to
69fdb0a
Compare
69fdb0a
to
b5e8fed
Compare
* [Email MFA] Updating fetchMFAPreference and updateMFAPreference (#13720) * add EMAIL MFA option in fetchMFAPreference * add EMAIL MFA option in updateMFAPreference * update fetchMFAPreference tests * update updateMFAPreference tests * update bundle size * remove redundant assertions * [Email MFA] Add support for EMAIL_OTP during sign in flows (#13745) * Confirm Sign In With Email OTP * Confirm Sign In Tests With Email OTP * Update packages/auth/src/types/models.ts Co-authored-by: israx <70438514+israx@users.noreply.github.com> * Fix Errant Pascal Casing --------- Co-authored-by: israx <70438514+israx@users.noreply.github.com> * feat(auth): [EMAIL MFA] Sign In / Confirm Sign In With MFA_SETUP (#13760) * Sign In / Confirm Sign In With MFA_SETUP * Sign In State Management Tests * Confirm Sign In Happy Path Tests * Fix State Management Tests * Apply Feedback * loose email matching * Remove Unnecessary Export * Update SignInHelpers For Getting Allowed MFA Setup Types * Add Error Case Unit Tests * feat(auth): [EMAIL MFA] enable integ tests with backend configuration swapping (#13794) * chore: enable mfa integ tests * chore: add mfa-setup test def * chore: temporarily enable push integ tests * chore: disable push integ tests * chore: address test strategy feedback * chore: use trimmed challenge response * chore: improved naming * chore: update bundle size tests * chore: remove trimmed challenge response --------- Co-authored-by: israx <70438514+israx@users.noreply.github.com>
Description of changes
The purpose of this pull request is to expand the MFA_SETUP challenge to support setting up and signing in with multiple MFA setup options - EMAIL and TOTP.
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.