]> cat aescling's git repositories - mastodon.git/commitdiff
Fix redirection when succeeded WebAuthn (#17098)
authorheguro <65112898+heguro@users.noreply.github.com>
Sun, 5 Dec 2021 20:50:12 +0000 (05:50 +0900)
committerGitHub <noreply@github.com>
Sun, 5 Dec 2021 20:50:12 +0000 (21:50 +0100)
app/controllers/concerns/two_factor_authentication_concern.rb

index 2583d324b55e7412d44bd5a42a5b5ec28d8a5259..27f2367a8ec9319f76cce68cb74de06ee7ae507d 100644 (file)
@@ -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