ruby on rails - Force Restful Authentication to login as a specific user (an admin function)? -
I am using strong authentication and I'm going to log on to our site as different users to check for problems They may be able to ("See what they see"). Since all passwords are encrypted I obviously can not use only my password.
So, how can I apply sessions to log in as a specific user?
-
Add action to your
sessions_controller
Impersonation
like this:imputation of def user = User.find (params [: id]) logout_killing_session!
-
Then expand session resources with member
in your routes. Cloned:
:map.resource: session ,: Member = & gt; {: Impersonation = & gt; Finally, add a button anywhere for every user named "Impersonation" in your admin views, it will have to look something like this (assuming That user is in the local variable
user
):
Comments
Post a Comment