-
Notifications
You must be signed in to change notification settings - Fork 166
Improve consistency when marking users as fully authenticated after successful multi-factor authenticator setup #8431
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -110,7 +110,7 @@ def handle_valid_otp_for_context(auth_method:) | |
| if UserSessionContext.authentication_or_reauthentication_context?(context) | ||
| handle_valid_otp_for_authentication_context(auth_method: auth_method) | ||
| elsif UserSessionContext.confirmation_context?(context) | ||
| handle_valid_verification_for_confirmation_context | ||
| handle_valid_verification_for_confirmation_context(auth_method: auth_method) | ||
| end | ||
| end | ||
|
|
||
|
|
@@ -168,9 +168,9 @@ def update_invalid_user | |
| current_user.increment_second_factor_attempts_count! | ||
| end | ||
|
|
||
| def handle_valid_verification_for_confirmation_context | ||
| user_session[:authn_at] = Time.zone.now | ||
| @next_mfa_setup_path = next_setup_path | ||
| def handle_valid_verification_for_confirmation_context(auth_method:) | ||
| user_session[:auth_method] = auth_method | ||
| mark_user_session_authenticated(:valid_2fa_confirmation) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm trying to follow how OTP previously would have set
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Previously it wouldn't have for phone OTP confirmation. We did do it when confirming other methods though, so this brings it all in line to always set it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, I assume this may cause some additional analytics to be logged via
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, they were causing a failure, added a few changes to add specs around it. |
||
| reset_second_factor_attempts_count | ||
| end | ||
|
|
||
|
|
||
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.
This line is only used by the
otp_verification_controllerwhen in a confirmation context, so it was moved there. Ideally I would have moved it in #8424