Commit c6c985bc authored by Douwe Maan's avatar Douwe Maan

Store original user in variable

parent 0ab98a8a
......@@ -3,13 +3,13 @@ class Admin::ImpersonationsController < Admin::ApplicationController
before_action :authenticate_impersonator!
def destroy
redirect_path = admin_user_path(current_user)
original_user = current_user
warden.set_user(impersonator, scope: :user)
session[:impersonator_id] = nil
redirect_to redirect_path
redirect_to admin_user_path(original_user)
end
private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment