Skip to content

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

@jigyasam

Description

@jigyasam

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions