Inconsistencies on Show page 2FA
Summary
While working on Issue #346494 (closed) We figured there are Issues on the show page apart from Error not getting generated when user enters Incorrect password. The inconsistencies observed are
-
Below Flash alert on the page when set, no other message can be displayed using flash[:alert]

-
Apart from flash we are using
@errorvariable to display errors to the user in case ofInvalid pinandInvalid passwordafter MR - !96056 (merged) is merged. WhenInvalid pinerror is set in controller we do not check forglobal settingsand the alert message is not displayed to the user. As can be seen in video here
Steps to reproduce
- Be part of a group that has
Require all users in this group to set up two-factor authenticationenabled - Log into a GitLab.com account without 2FA enabled.
- Go into User settings -> Preferences -> Account -> Enable Two-factor Authentication.
Check video for further steps.
Issue is the way we are using flash to set a message as soon as the page loads as described in comment here !96056 (comment 1126768577) .
Proposal
Use a separate div to display global setting message and use flash for other error messages which can be set during redirects.
