Cms: Requesting an easier way to return to control panel after impersonating a user

Created on 16 Dec 2020  Â·  3Comments  Â·  Source: craftcms/cms

Description

Impersonating a user is a great feature. Thank you! It's especially useful for some e-commerce administrators. Id like to request that getting back to the control panel as an admin, after impersonating a user, be improved if possible.

Currently, you impersonate a user from the control panel and are taken to the frontend. When you're ready to return to the control panel you must logout of the impersonated user's account and re-login to the admin.

I'd like to request a way to get back to the admin without logging out and then logging back in. Not sure the best way to handle this, but perhaps a route and maybe an event/session var to allow developers to output a button returning to the control panel on the frontend would work.

enhancement user management

Most helpful comment

Just came up with what I think is a pretty nice solution to this.

In Craft 3.6 there will be a new user action after “Login as [username]”, called “Copy impersonation URL”:

The user action menu, with the new “Copy impersonation URL” option highlighted

When you click it, Craft will generate a single-use tokenized URL, and then prompt you to copy it:

The “Copy URL” prompt

You’ll then be able to copy the URL and paste it into a new private/incognito window, which will log you in as the user and redirect you to either the control panel or front end, depending on whether they have CP access.

All 3 comments

Just came up with what I think is a pretty nice solution to this.

In Craft 3.6 there will be a new user action after “Login as [username]”, called “Copy impersonation URL”:

The user action menu, with the new “Copy impersonation URL” option highlighted

When you click it, Craft will generate a single-use tokenized URL, and then prompt you to copy it:

The “Copy URL” prompt

You’ll then be able to copy the URL and paste it into a new private/incognito window, which will log you in as the user and redirect you to either the control panel or front end, depending on whether they have CP access.

Craft 3.6 RC3 is out now with that change.

Craft 3.6 has now been officially released ✨

Was this page helpful?
0 / 5 - 0 ratings