Username must change after first login


I want to develop a Plugin that when the user logged in first time, user must change his/her username. but I don’t know how to redirect to my plugin or changing username page.
Are there any suggestion?

Thanks for your help.


Are you wanting to have them change their username or their real name?

If username, why? They can either set this themselves or it’s autogenerated based upon email address.

If name, I believe there’s a way to do this built-in to Discourse.


We are planning to create automatically a forum user with our crm system’s “username” via Discourse’s APIs. and then user must change this. because it maybe contains personal info.
this is problem for us.

1 Like

What you’re proposing sounds like a really bad idea.

How many users are there? Your best bet is to fix the data in the CRM.

Option 1: Almost what you asked for

But the CRM surely has a unique ID of some sort that you could use instead of the personal-info-username. If there isn’t some kind of ID, you could just generate a hash of their email address for their username. Then users who wanted not to have a stupid username could change it, but no one’s personal information could be at risk of being spread.

Option 2: What you’re asking for

To do what you’re asking, you’d need a plugin that added a user custom field like “crm_username” and then did something like refuse to let them log in until they changed it. The UX would be bad, expensive, or both. Maybe you could just redirect them to the profile page until they changed it. This is the kind of plugin that is likely to break and will be difficult to maintain.

Option 3

Or you could just send invites and let them join and create their own account if they wanted to. That’s probably the best solution.

If you really want a plugin, you can ask in #marketplace.