Gebruikersnaam met Japanse tekens die een nummer toevoegen

AI-generated summary

A user, sweetbeems, reported that their username ‘賢治’ was automatically changed to ‘賢治1’ during single sign-on due to a uniqueness constraint. Despite no existing user with that username, the issue persisted. maiki suggested checking the ‘min username length’ setting, which was set to 3. Adjusting it to 2 resolved the issue, and sweetbeems confirmed the fix, later reducing it to 1 to accommodate single-character usernames. maiki advised ensuring the minimum length aligns with user needs.

Hi Discourse!

I recently started a site and I’ve encountered the issue described below.

Issue

  • Username ‘賢治’ always automatically changes to ‘賢治1’ whenever I send my single sign on payload.

Strangely, the name is ok with being ‘賢治’, just not the username. This makes me think it’s some sort of uniqueness issue with the username… but I checked the rails console and there is no user with the username ‘賢治’. Is there some other place I should check for the uniqueness constraint? Is it a special chars issue?

Context
I only recently started my discourse site and I originally started it without the ‘unicode usernames’ checked. However, after updating the settings I went through and updated the affected users. The other user with special chars in their name did not get a number appended to their username.

Unicode Settings

  • ‘unicode usernames’ → allowed
  • ’ allowed unicode username characters’ → [\p{Han}\p{Katakana}\p{Hiragana}]

Payload
name=%E8%B3%A2%E6%B2%BB
username=%E8%B3%A2%E6%B2%BB

Any help would be greatly appreciated. Thanks!

Hello @sweetbeems! :wave:

I have not run into this particular issue, but this…

…made me think of the min username length setting.

Did that user have more characters in their name? The default of min username length is 3, so maybe setting that to 2 will resolve this issue. :thinking:

Ah, wonderful!! @maiki you’re completely right and that fixed it! Changing to two was the solution. I may even need to change to one..

Thank you!!

You’re welcome.

Glad that worked! If you think you may have users using a single unicode character for a username, then you probably need to change that setting to 1; otherwise they won’t be able to sign-up unless they use 2 characters. :slight_smile:

Yes, I don’t have a minimum restriction on my main site I’m authenticating with via single sign on, so moved down to 1 character minimum :slight_smile: