summaryrefslogtreecommitdiff
path: root/lib/authenticated_system.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/authenticated_system.rb')
-rw-r--r--lib/authenticated_system.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/authenticated_system.rb b/lib/authenticated_system.rb
index 04d8051f..668436b5 100644
--- a/lib/authenticated_system.rb
+++ b/lib/authenticated_system.rb
@@ -25,9 +25,10 @@ module AuthenticatedSystem
25 # Tied to is_admin? so losing the role closes the window at once, rather 25 # Tied to is_admin? so losing the role closes the window at once, rather
26 # than leaving a timestamp that would count again if the role returned. 26 # than leaving a timestamp that would count again if the role returned.
27 def elevated? 27 def elevated?
28 return false unless current_user&.is_admin? 28 return false unless current_user&.is_admin?
29 session[:elevated_at].to_i > ELEVATION_MAX_AGE.ago.to_i 29 return false unless current_user.otp_enrolled?
30 end 30 session[:elevated_at].to_i > ELEVATION_MAX_AGE.ago.to_i
31 end
31 32
32 def elevation_expires_at 33 def elevation_expires_at
33 return nil unless elevated? 34 return nil unless elevated?