mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Don't check for second factor when switching to anonymous account (#7803)
This commit is contained in:
@@ -43,6 +43,7 @@ export default RestrictedUserRoute.extend({
|
||||
if (
|
||||
transition.targetName === "preferences.second-factor" ||
|
||||
!user ||
|
||||
(settings.allow_anonymous_posting && user.is_anonymous) ||
|
||||
user.second_factor_enabled ||
|
||||
(settings.enforce_second_factor === "staff" && !user.staff) ||
|
||||
settings.enforce_second_factor === "no"
|
||||
|
@@ -745,6 +745,7 @@ class ApplicationController < ActionController::Base
|
||||
check_totp = current_user &&
|
||||
!request.format.json? &&
|
||||
!is_api? &&
|
||||
!(SiteSetting.allow_anonymous_posting && current_user.anonymous?) &&
|
||||
((SiteSetting.enforce_second_factor == 'staff' && current_user.staff?) ||
|
||||
SiteSetting.enforce_second_factor == 'all') &&
|
||||
!current_user.totp_enabled?
|
||||
|
Reference in New Issue
Block a user