summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-08-01 01:10:35 +0200
committererdgeist <erdgeist@erdgeist.org>2026-08-01 01:10:35 +0200
commitf6c1f0f08f031778a491465d35ac694bfcdc12b0 (patch)
tree99aec0f419b1122821124fdb7ae8bdf4bc5831db /config/routes.rb
parentdf90138fb55f7d3652d3d69d58325d7329920f51 (diff)
Require a fresh second factor for user management
Administrative actions are gated behind a 30-minute elevation window: creating and retiring accounts, editing roles, clearing a second factor. Reading the list is not gated, and content work is untouched. elevated? is tied to is_admin?, so losing the role closes the window at once. The window opens when the second factor verifies at login, so an admin heading straight for user management is already elevated, and closes on logout with the other session state. Five wrong codes end the session, mirroring the login challenge. users#update carries no elevation filter, since self-service reaches it; the role field is gated in user_params instead and fails closed.
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 1898dbbb..4c37e70f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -106,6 +106,7 @@ Cccms::Application.routes.draw do
106 end 106 end
107 resource :otp_enrollment, :only => [:show, :create, :update, :destroy] 107 resource :otp_enrollment, :only => [:show, :create, :update, :destroy]
108 resource :otp_challenge, :only => [:new, :create] 108 resource :otp_challenge, :only => [:new, :create]
109 resource :elevation, :only => [:new, :create, :destroy]
109 110
110 resources :menu_items, :except => :show do 111 resources :menu_items, :except => :show do
111 member do 112 member do