Skip to content

Commit 81db87f

Browse files
improve must_activate_twofa? support
1 parent b20c981 commit 81db87f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/redmine_sudo/patches/user_patch.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,10 @@ def deliver_security_notification
5353

5454
# admin? has been replaced with sudoer?
5555
def must_activate_twofa?
56-
return false if twofa_active?
56+
rc = super
57+
return rc if rc
5758

58-
return true if Setting.twofa_required?
59-
return true if Setting.twofa_required_for_administrators? && sudoer?
60-
return true if Setting.twofa_optional? && groups.any?(&:twofa_required?)
59+
!twofa_active? && Setting.twofa_required_for_administrators? && sudoer?
6160
end
6261
end
6362

0 commit comments

Comments
 (0)