Class: Admin::TestingUserSessionsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/admin/testing_user_sessions_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


4
5
6
7
8
9
10
11
# File 'app/controllers/admin/testing_user_sessions_controller.rb', line 4

def create
  return unless current_admin.root?
  @user = User.find(params[:id])
  logger.info "Admin #{current_admin.id} is logging in as user #{@user.id}"
  SignonStatusTokenService.write_to_cookie(cookies, @user) if @user.confirmed?
  SiteIdentityTokenService.create(cookies, @user) if @user.confirmed?
   @user, event: :authentication
end