Просмотр исходного кода

Fixes #4989 - Erroneous error message during password reset.

Dusan Vuckovic 3 месяцев назад
Родитель
Сommit
79c32e8f04

+ 10 - 15
app/assets/javascripts/app/controllers/password_reset_verify.coffee

@@ -101,6 +101,12 @@ class PasswordResetVerify extends App.ControllerFullPage
 
   renderChanged: (data, status, xhr) =>
     if data.message is 'ok'
+      @notify(
+        type:      'success'
+        msg:       __('Woo hoo! Your password has been changed!')
+        removeAll: true
+      )
+
       App.Auth.login(
         data:
           username: data.user_login
@@ -110,25 +116,14 @@ class PasswordResetVerify extends App.ControllerFullPage
           # login check
           App.Auth.loginCheck()
 
-          # add notify
-          @notify(
-            type:      'success'
-            msg:       __('Woo hoo! Your password has been changed!')
-            removeAll: true
-          )
-
           # redirect to #
           @navigate '#'
 
         error: =>
-          @formEnable(@$('form'))
-
-          # add notify
-          @notify(
-            type:      'error'
-            msg:       __('Something went wrong. Please contact your administrator.')
-            removeAll: true
-          )
+          # The user may have an active 2FA method on their account, which will prevent an automatic login (#4989).
+          #   Instead, silently redirect to login screen and allow the user to login manually
+          #   and complete their 2FA challenge.
+          @navigate '#'
       )
     else
       if data.notice

+ 1 - 1
app/frontend/apps/desktop/pages/authentication/views/Login.vue

@@ -200,7 +200,7 @@ const showPasswordLogin = computed(
           <div v-if="$c.user_create_account" class="flex justify-center py-3">
             <CommonLabel>
               {{ $t('New user?') }}
-              <CommonLink link="/signup" class="select-none">{{
+              <CommonLink link="/signup" class="select-none" size="medium">{{
                 $t('Register')
               }}</CommonLink>
             </CommonLabel>

+ 2 - 6
i18n/zammad.pot

@@ -13451,10 +13451,6 @@ msgstr ""
 msgid "Something went wrong."
 msgstr ""
 
-#: app/assets/javascripts/app/controllers/password_reset_verify.coffee:129
-msgid "Something went wrong. Please contact your administrator."
-msgstr ""
-
 #: app/frontend/shared/errors/useErrorHandler.ts:35
 msgid "Something went wrong. Received message: %s"
 msgstr ""
@@ -14659,7 +14655,7 @@ msgid "The parameter 'mentionable_type' is invalid."
 msgstr ""
 
 #: app/assets/javascripts/app/controllers/_profile/password.coffee:135
-#: app/assets/javascripts/app/controllers/password_reset_verify.coffee:143
+#: app/assets/javascripts/app/controllers/password_reset_verify.coffee:138
 msgid "The password could not be set. Please contact your administrator."
 msgstr ""
 
@@ -17675,7 +17671,7 @@ msgstr ""
 msgid "Woo hoo! Your email address has been verified!"
 msgstr ""
 
-#: app/assets/javascripts/app/controllers/password_reset_verify.coffee:116
+#: app/assets/javascripts/app/controllers/password_reset_verify.coffee:106
 #: app/frontend/apps/desktop/pages/authentication/views/PasswordResetVerify.vue:129
 msgid "Woo hoo! Your password has been changed!"
 msgstr ""