Username must change after first login

AI-generated summary

The discussion revolves around a plugin requirement to force users to change their username after first login, as usernames are automatically created from CRM data and may contain personal information. masum0813 seeks guidance on redirecting users to a username change page. justin questions whether the goal is to change the username or real name, noting Discourse has built-in options for the latter. masum0813 clarifies the need to prevent personal info exposure. pfaffman advises against the approach, suggesting better solutions like using a unique ID or email hash for usernames, or sending invites for self-registration. He also warns that implementing such a plugin would be complex, potentially breakable, and poor in user experience, recommending seeking help in Marketplace for plugin development.

Hi,

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.

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.