I’m pre-populating users in Discourse from an integrated SSO external system and would like to mimic the username creation process in Discourse.
Currently, I’m having to create usernames like so, where the number is the unique user id.
I tried using portions of name or email but always ended up with complaints about special characters.
When a user logs into the site using SSO, the username is automagically created. The username is a reasonable representation of the user and I’d like to copy this functionality with my pre-populated users.
Does anyone know what the logic is and/or can point me to the code in GIT that performs the magic?