From 41503507ec34175a759e5ae7c04fc2afb77ff2b7 Mon Sep 17 00:00:00 2001 From: heguro <65112898+heguro@users.noreply.github.com> Date: Mon, 6 Dec 2021 05:50:12 +0900 Subject: [PATCH] Fix redirection when succeeded WebAuthn (#17098) --- app/controllers/concerns/two_factor_authentication_concern.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/concerns/two_factor_authentication_concern.rb b/app/controllers/concerns/two_factor_authentication_concern.rb index 2583d324b5..27f2367a8e 100644 --- a/app/controllers/concerns/two_factor_authentication_concern.rb +++ b/app/controllers/concerns/two_factor_authentication_concern.rb @@ -57,7 +57,7 @@ module TwoFactorAuthenticationConcern if valid_webauthn_credential?(user, webauthn_credential) on_authentication_success(user, :webauthn) - render json: { redirect_path: root_path }, status: :ok + render json: { redirect_path: after_sign_in_path_for(user) }, status: :ok else on_authentication_failure(user, :webauthn, :invalid_credential) render json: { error: t('webauthn_credentials.invalid_credential') }, status: :unprocessable_entity