about summary refs log tree commit diff
path: root/app/controllers/concerns/two_factor_authentication_concern.rb
diff options
context:
space:
mode:
authorheguro <65112898+heguro@users.noreply.github.com>2021-12-06 05:50:12 +0900
committerGitHub <noreply@github.com>2021-12-05 21:50:12 +0100
commit41503507ec34175a759e5ae7c04fc2afb77ff2b7 (patch)
tree0d1abcc3d9057fd44ab24156de5c36036db41902 /app/controllers/concerns/two_factor_authentication_concern.rb
parent66baa629ea1c3890d5c631099d41e6af14974d7e (diff)
Fix redirection when succeeded WebAuthn (#17098)
Diffstat (limited to 'app/controllers/concerns/two_factor_authentication_concern.rb')
-rw-r--r--app/controllers/concerns/two_factor_authentication_concern.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/concerns/two_factor_authentication_concern.rb b/app/controllers/concerns/two_factor_authentication_concern.rb
index 2583d324b..27f2367a8 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