Hi , for user impersonation when we log out of the impersonated user will the admin still be logged it as an admin or the complete session is logged out
r
rp_st
12/06/2023, 6:09 PM
It will be a complete logout
d
doraig
12/09/2023, 7:08 PM
Is there api for stop impersonation?
r
rp_st
12/09/2023, 7:10 PM
you could make one by creating an API that logs back the user in as the admin user, just like they logged in as the impersonated user.
For this to be secure, you can add the admin user ID in the impersonated user session (in the access token payload), and only allow switching from user -> admin, if the user's session contains this custom claim that points to an admin user ID.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).