From bbab50fa62ce1f131d1d2992a4af6f904104f79d Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Wed, 5 Jun 2024 14:17:58 -0400 Subject: [PATCH] In some cases, the server returns `user_second_factors` as the error key in the response --- .../javascripts/discourse/app/controllers/password-reset.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/controllers/password-reset.js b/app/assets/javascripts/discourse/app/controllers/password-reset.js index 850a4aaaf04..d6787d93a7a 100644 --- a/app/assets/javascripts/discourse/app/controllers/password-reset.js +++ b/app/assets/javascripts/discourse/app/controllers/password-reset.js @@ -93,7 +93,10 @@ export default Controller.extend(PasswordValidation, { DiscourseURL.redirectTo(result.redirect_to || "/"); } } else { - if (result.errors.security_keys) { + if ( + result.errors.security_keys || + result.errors.user_second_factors + ) { this.setProperties({ secondFactorRequired: this.secondFactorRequired, securityKeyRequired: this.securityKeyRequired,