switch_user
switch_user copied to clipboard
original_user is nill
helo
when i want to switch back to original user. it returns a nill value
so how do we solve this?
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.
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
+1
Worked for me after upgrading the gem to 1.5.0
.