Home > Software design >  Connect to user account
Connect to user account

Time:10-12

My app is on RoR. I'm using devise and rails admin.

The platform has some users. Sometime, admin account needs to access / login to their account.

Do you any ideas how to do that ?

Thanks

CodePudding user response:

You can just use Devise sign_in method, like this: sign_in(@user). You will be authorized as user you've passed to sign_in method.

Or you can use sign_in_and_redirect method, which will redirect you to another page after login.

Documentation: https://www.rubydoc.info/github/plataformatec/devise/Devise/Controllers/Helpers:sign_in_and_redirect

CodePudding user response:

I think what you might need it's an "impersonation" system to be able to act as the user.

There's a known solution for Ruby On Rails called Pretender that you can easily integrate with your project.

  • Related