mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Lock down the controllers
This commit is contained in:
parent
3045c08b3e
commit
3b1e632ab7
36 changed files with 166 additions and 97 deletions
|
@ -8,8 +8,6 @@ class SessionsController < Devise::SessionsController
|
|||
|
||||
return redirect_to :back, alert: 'No user' if @user.blank?
|
||||
|
||||
session[:current_user_registrar_id] = Registrar.first.id if @user.admin?
|
||||
|
||||
flash[:notice] = I18n.t('shared.welcome')
|
||||
sign_in_and_redirect @user, event: :authentication
|
||||
# end
|
||||
|
@ -18,10 +16,4 @@ class SessionsController < Devise::SessionsController
|
|||
def login
|
||||
render 'layouts/login', layout: false
|
||||
end
|
||||
|
||||
def switch_registrar
|
||||
authorize! :switch, :registrar
|
||||
session[:current_user_registrar_id] = params[:registrar_id]
|
||||
redirect_to client_root_path
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue