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

Use setup_webauthn_authentication helper method in updating MFA level #3963

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 1 addition & 13 deletions app/controllers/multifactor_auths_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def update
@user = current_user

@otp_verification_url = otp_update_multifactor_auth_url(token: current_user.confirmation_token)
setup_webauthn_authentication
setup_webauthn_authentication(form_url: webauthn_update_multifactor_auth_url(token: current_user.confirmation_token))

create_new_mfa_expiry

Expand Down Expand Up @@ -139,18 +139,6 @@ def seed_and_expire
end
end

def setup_webauthn_authentication
return if current_user.webauthn_disabled?

@webauthn_verification_url = webauthn_update_multifactor_auth_url(token: current_user.confirmation_token)

@webauthn_options = current_user.webauthn_options_for_get

session[:webauthn_authentication] = {
"challenge" => @webauthn_options.challenge
}
end

def update_level_and_redirect
handle_new_level_param
redirect_to session.fetch("mfa_redirect_uri", edit_settings_path)
Expand Down