switch_user icon indicating copy to clipboard operation
switch_user copied to clipboard

original_user is nill

Open hendranata opened this issue 8 years ago • 4 comments

helo

when i want to switch back to original user. it returns a nill value

so how do we solve this?

hendranata avatar Jul 14 '16 01:07 hendranata

I found out that if u set the /switch_user/remember_user?remember=true in devise after_sign_in_path like so

#app/helper/devise_helper.rb

module RedirectionHelper
  def after_sign_in_path_for(resource)
    `/switch_user/remember_user?remember=true`
  end
end

Then you will be fine again. The original user wont be nil. This only works if you use Devise.

rajahafify avatar Sep 26 '16 07:09 rajahafify

That didn't work for me. Original user is always nil. Any ideas?

I saw there's meant to be a session value for the original user, this is also always not present for me.

:original_user_scope_identifier

rathboma avatar May 26 '17 16:05 rathboma

+1

23ranjan avatar Sep 17 '18 10:09 23ranjan

Worked for me after upgrading the gem to 1.5.0.

23ranjan avatar Sep 17 '18 13:09 23ranjan