summaryrefslogtreecommitdiff
path: root/lib/authenticated_test_helper.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-01 18:38:42 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-01 18:38:42 +0200
commit45432cba9f524c99015c90b6b6aa381fe2b04984 (patch)
tree35345a3efedeaa1bd63db09ff99ac23187c081e3 /lib/authenticated_test_helper.rb
parent4175f26cc8b22ff5a07929fa2436c561022cccd2 (diff)
Require a second factor for elevation, not for holding admin
Diffstat (limited to 'lib/authenticated_test_helper.rb')
-rw-r--r--lib/authenticated_test_helper.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/authenticated_test_helper.rb b/lib/authenticated_test_helper.rb
index 065a5f7d..483e6c88 100644
--- a/lib/authenticated_test_helper.rb
+++ b/lib/authenticated_test_helper.rb
@@ -6,6 +6,10 @@ module AuthenticatedTestHelper
6 end 6 end
7 7
8 def elevate_session! 8 def elevate_session!
9 session[:elevated_at] = Time.now.to_i 9 user = User.find_by(:id => @request.session[:user_id])
10 if user && !user.otp_enrolled?
11 user.update_column(:otp_secret, ROTP::Base32.random)
12 end
13 @request.session[:elevated_at] = Time.now.to_i
10 end 14 end
11end 15end