Skip to content

Commit

Permalink
Merge pull request #3963 from Shopify/use-webauthn-verifiable
Browse files Browse the repository at this point in the history
Use `setup_webauthn_authentication` helper method in updating MFA level
  • Loading branch information
jenshenny committed Jul 28, 2023
2 parents 5a95b05 + ddf9e6c commit 514db82
Showing 1 changed file with 1 addition and 13 deletions.
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

0 comments on commit 514db82

Please sign in to comment.