Class: Admin::ImpersonationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/admin/impersonations_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject


5
6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/admin/impersonations_controller.rb', line 5

def destroy
  original_user = current_user

  warden.set_user(impersonator, scope: :user)

  Gitlab::AppLogger.info("User #{original_user.username} has stopped impersonating #{impersonator.username}")

  session[:impersonator_id] = nil

  redirect_to admin_user_path(original_user)
end