How to implement Admin Login as a specific user in express js

106 Views Asked by At

I have created multiple auth systems where a user can sign in through multiple ways. In this one project, I created an admin dashboard,and wanted to add this feature where the admin can login as a user X, and see what the user sees, and make sure everything works fine. How can I implement this in Express JS, where the authentication is being done by the user using Email and Password. I am currently using JWT strategy for session.

Any Ideas and Discussions are appreciated!

So the basic idea that I got is, to create an endpoint which is accessible to only admin and it returns the jwt token of a specific user. But I am not sure if it is safe or not, and also what will be the best approach to get them to the main site instead of admin, and implement this specific problem.

0

There are 0 best solutions below