Extract Registrar::CurrentUserController from SessionsController

#600
This commit is contained in:
Artur Beljajev 2017-10-04 01:00:24 +03:00
parent c1875ec88e
commit 787cca8e4c
9 changed files with 134 additions and 46 deletions

View file

@ -0,0 +1,12 @@
class Registrar
class CurrentUserController < BaseController
skip_authorization_check
def switch
new_user = ApiUser.find(params[:new_user_id])
sign_in(new_user) if new_user.identity_code == current_user.identity_code
redirect_to :back, notice: t('.switched', new_user: new_user)
end
end
end