As pointed out below, you don’t actually need a plugin to easily switch users in development:
That said, this plugin might still be useful if you want easy links to switch accounts quickly.
When developing Discourse, I often find it’s useful to switch between user accounts. My general workflow currently looks something like this:
- Open incognito window
- Login using the admin account credentials that I remember (most of the time)
- Pick a user
If I want to change to another user, or inevitably close the incognito window by accident, I repeat that process again. Gets tedious very quickly.
When experimenting with various chat systems for
discourse-chat-integration, I installed the development version of Zulip. I really liked the way they handle authentication when running in development mode: you just click a username and you’re in!
So, stealing that concept, this plugin replicates that functionality in Discourse. It adds a box to the footer, containing a list of every user (max. 50) on your development instance. All you do to login is click the username . The implementation is identical to the admin “impersonate” feature, but without all the safety features.
The footer is visible on every page, so you can switch users without even logging out!
The repository is available at https://github.com/davidtaylorhq/discourse-dev-login