Add 'stop impersonating' link to user avatar dropdown when impersonating

As far as I’m aware, there is currently no way to ‘stop impersonating’ a user. In order to do this now, you have to log out, and then log back in as yourself.

It’d be nice if there were a link to ‘stop impersonating’ the user in the user avatar dropdown menu:

31 Likes

We would need to start tracking that you are impersonating for that to work :slight_smile:

3 Likes

Well, wouldn’t mind that Discourse would track that. :smile:

https://meta.discourse.org/t/don-t-change-last-seen-when-impersonating-a-user/5764

2 Likes

Totally for fixing this, its just a bit hairy.

5 Likes

Are you really impersonating users so much that this is a problem? Seems like a lot of work for little benefit.

2 Likes

No, its a very minor issue. Consider this documentation for the workaround until such a time its deemed worthy of attention.

3 Likes

Ran into this myself right now. Still corner-case, but it is rather annoying when it does happen, just for the record ^^

Even a “secret” URL shortcut to get you back would be a great first step. I could be made aware of such a trick via the admin guide.

5 Likes

Would the mechanics for switching out of anonymous mode be applicable to this feature?

I can implement it, but I don’t want to gold plate impersonation, logging when someone impersonates has to come first

5 Likes

Looking forward to having this option. I end up impersonating folks quite a lot as we develop features/test things out and it is a huge hassle to get out of it since I have to go through multiple screens to re-login (due to SSO).

7 Likes

Was this ever implemented?

1 Like

Nope, did not happen, I feel odd adding more polish around impersonation

So what is the workaround?

I think he was referring to this:

3 Likes

@Sam Sorry for reviving this old post but since impersonations are now logged could this feature be built in the future or is it in your list of things to work on?

4 Likes

Still not tracked per auth token, we would need a new column for that.

Over the years I have had so little motivation to do anything here short of adding tracking, I feel like impersonation is simply something to be avoided, the friction here can be seen as a feature.

6 Likes

Though I understand your reticence to improve it, I hardly think trapping people in a mode you want them to avoid makes sense as a feature. It has legitimate uses, which is why it was added and why I use it.

I don’t really mind being forced to logout to quit impersonating though. The problem is that I can’t figure out how to logout without clearing their notification count (because I have to click on their profile menu to get to the logout menu item.) This is confusing and unhelpful for the user being helped via impersonation.

Is there a url I can visit to logout directly? Or is there some other way to avoid this problem?

2 Likes

Simplest workaround is:

  • Open a new browser
  • Head to /u/USERNAME/preferences/account
  • Find culprit device in “Recently Used Devices”
  • Click wrench
  • Log it out

If you are in the habit of always impersonating from an incognito session this should be fairly easy.

8 Likes

Thanks for the solution as well as the tip about using incognito mode.

2 Likes

A loud banner at the top to indicate impersonation, with a button on it to release the account would be a great way to round out this functionality.

This is what django-hijack looks like:

image

14 Likes