cybernetisk / internsystem-v2

A NextJS-based website. Used for public information about Cybernetisk Selskab, and necessary tools for volunteers at the bar/café Escape.
https://cyb.no
MIT License
7 stars 9 forks source link

Impersonate button for admin users for ease of testing #71

Open Sebbben opened 1 month ago

Sebbben commented 1 month ago

Describe the problem you are experiencing Since the system is set up to require a valid email to be able to log in, it would be very handy to have a button (at least for test builds) that allows admin users to impersonate other users.

Describe the solution you'd like I think a somewhat good solution would be to have some list over all users with their roles shown on an admin page with an impersonate-button that when clicked will log the user out of the admin user, and into the impersonated user without the need to send the magic link email.

Additional context Of course this is a security risk to have in a production build, so the feature should either be contained to dev builds only, or at least be very well secured. This feature would help to more easily be able to test access control for different user roles without the need to have multiple working users. This would also simplify the users needed to be entered into the database for a MVP on the local hosting of the mysql server with docker