Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current_user and true_user. #115

Closed
23ranjan opened this issue Feb 26, 2018 · 4 comments
Closed

Current_user and true_user. #115

23ranjan opened this issue Feb 26, 2018 · 4 comments

Comments

@23ranjan
Copy link

Hi,

Is there any way to track the true_user as well?

For e.g if user-A switches to user-B profile then current_user will be user-B but is there any way to get user-A as well ?

@23ranjan
Copy link
Author

Also is there any way to switch back from user to true_user (for e.g from current_user to true_user)

@flyerhzm
Copy link
Owner

@23ranjan yes, check switch back in README

@23ranjan
Copy link
Author

Hi @flyerhzm

We do not have a drop down to select swithc_users, instead of this - we use a link to switch in to other user's profile, something like :- "/switch_user?scope_identifier=user_#{user.id}"

I wonder what would be the switch_back url ?

I am currently using switch_user 1.2.1 and I've following changes in my config:-

config.switch_back = true

 config.controller_guard = lambda { |current_user, request, original_user|

    current_user.try(:has_any_role?, :admin) || original_user.try(:has_any_role?, :admin)

  }

@23ranjan
Copy link
Author

23ranjan commented Feb 27, 2018

Also in my switch url, I'm adding remember=true as well as mentioned in Ghost's answer - #55

@23ranjan 23ranjan closed this as completed Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants