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

Remember "original_user" for switch_back does not respect SwitchUser.available_users_identifiers #73

Open
jigyasam opened this issue May 27, 2015 · 1 comment

Comments

@jigyasam
Copy link

Hi

Thanks for the gem, it works really well for my Rails - devise setup. However I'm facing this issue where I have the user identifier other than ID:

config.available_users_identifiers = { :user => :slug }

When I check the checkbox next to switch_user_select before switching from "admin" to a "user" for switching back, the value stored in the session[:original_user_scope_identifier] is still "user_ID" instead of "user_SLUG". Consequently, I cannot "switch back" as the saved admin user cannot be found with the query:

User.where(slug: ID_stored_in_session) 

If I find some time, I'd try to submit a pull request with a fix. Reporting it until then :)

@styledev
Copy link

styledev commented Sep 9, 2015

Bump, I am seeing this too.

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