Username with Japanese characters appending a number

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!

1 Like

こんにちは @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:

3 Likes

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…

ありがとうございます!!

3 Likes

どういたしまして.

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:

2 Likes

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:

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.