summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-31 17:05:05 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-31 17:05:05 +0200
commit8c6a6516e1dc5c1b4f12740a6f7b32765b530bb7 (patch)
treee40a1da656bedef0662f0e984b4e3b00b374bc1d /config/routes.rb
parent464dd4266bdc433805010b5dca428f4cb75c2a81 (diff)
Replace user deletion with deactivation
Deactivation adds the alumni role and leaves the others in place, so reactivation is lossless and nobody has to remember what an account held. login_from_session checks alumni? on every request, so a signed-in user is locked out on their next one without any session invalidation. Guards prevent deactivating yourself or the last active admin, and both verbs are witnessed in the action log.
Diffstat (limited to 'config/routes.rb')
-rw-r--r--config/routes.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 4b5d15c9..1898dbbb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -97,9 +97,11 @@ Cccms::Application.routes.draw do
97 match '/login' => 'sessions#new', :as => :login, :via => :get 97 match '/login' => 'sessions#new', :as => :login, :via => :get
98 match 'search' => 'search#index', :as => :search, :via => :get 98 match 'search' => 'search#index', :as => :search, :via => :get
99 99
100 resources :users do 100 resources :users, :except => :destroy do
101 member do 101 member do
102 put :reset_otp 102 put :reset_otp
103 put :deactivate
104 put :reactivate
103 end 105 end
104 end 106 end
105 resource :otp_enrollment, :only => [:show, :create, :update, :destroy] 107 resource :otp_enrollment, :only => [:show, :create, :update, :destroy]