FEATURE: better UI to manage 2fa (#19338)

In this PR, we introduced an option, that when all authenticators are disabled, but backup codes still exists, user can authenticate with those backup codes. This was reverted as this is not expected behavior.

https://github.com/discourse/discourse/pull/18982

Instead, when the last authenticator is deleted, backup codes should be deleted as well. Because this disables 2fa, user is asked to confirm that action by typing text.

In addition, UI for 2fa preferences was refreshed.
This commit is contained in:
Krzysztof Kotlarek
2022-12-08 09:41:22 +11:00
committed by GitHub
parent 63119144ff
commit e313190fdb
25 changed files with 297 additions and 152 deletions

View File

@@ -79,7 +79,7 @@ module SecondFactorManager
end
def has_any_second_factor_methods_enabled?
totp_enabled? || security_keys_enabled? || backup_codes_enabled?
totp_enabled? || security_keys_enabled?
end
def has_multiple_second_factor_methods?