FIX: clear previous errors on second factor form display (#14987)

FIX: clear previous errors on second factor form display (#14987)

diff --git a/app/assets/javascripts/discourse/app/controllers/login.js b/app/assets/javascripts/discourse/app/controllers/login.js
index b36eddc..ef43315 100644
--- a/app/assets/javascripts/discourse/app/controllers/login.js
+++ b/app/assets/javascripts/discourse/app/controllers/login.js
@@ -160,6 +160,7 @@ export default Controller.extend(ModalFunctionality, {
           // Successful login
           if (result && result.error) {
             this.set("loggingIn", false);
+            this.clearFlash();
 
             if (
               (result.security_key_enabled || result.totp_enabled) &&

GitHub sha: 113ecab7a633fdd58347071b5429965e7c62c2fa

This commit appears in #14987 which was approved by CvX. It was merged by jjaffeux.