mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 10:19:45 +02:00
Context switching for client
This commit is contained in:
parent
5dfee40b87
commit
b48b91878d
9 changed files with 44 additions and 12 deletions
|
@ -6,6 +6,8 @@ class SessionsController < Devise::SessionsController
|
|||
@user = User.find_by(username: 'gitlab') if params[:gitlab]
|
||||
@user = User.find_by(username: 'zone') if params[:zone]
|
||||
|
||||
session[:current_user_registrar_id] = Registrar.first.id if @user.admin?
|
||||
|
||||
flash[:notice] = I18n.t('shared.welcome')
|
||||
sign_in_and_redirect @user, :event => :authentication
|
||||
return
|
||||
|
@ -15,4 +17,10 @@ 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