Simulating Users

It’s not unusual for customers to have issues with the website that are specific to their circumstances—something in their data or history with the site that is causing a strange condition.

It’d be great if you could log in as the user, but we don’t save user passwords in any way that’s recoverable. However, we can do the next best thing: we can use Devise to allow our administrators to temporarily assume the identity of a user.

This is actually rather easy to do technically, but it comes with a host of secondary issues. Simulating a user login is potentially dangerous and opens you up to privacy concerns that we’ve spent most of this book trying to avoid. You need to be very careful with this feature.

All that said, it’s still ...

Get Take My Money now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.