A user, fefrei, is experiencing an issue where they cannot change a username due to SSO being enabled. They receive an error message stating āThere was an error changing your username.ā codinghorror suggests it may be due to a length restriction. fefrei discovers the issue is caused by the setting āsso overrides username.ā They consider this a bug, suggesting that the setting should either hide the āChange Usernameā button or allow admins to make changes with a warning. andrei finds a PR that adds test cases for this issue and later discovers (andrei) that the issue is already fixed, with the āChange Usernameā button being hidden when the setting is enabled, and a warning message displayed when an admin attempts to change a username.
When renaming a user (from jb1 to jb), I get this error message: There was an error changing your username.
No information is recorded in /logs.
The old username was created because the user used SSO for the first time, and his name was too short. Now, I changed the minimum username length, and wanted to adjust his name.
Changing username minimum after the fact (e.g. setting minimum username length to 4 chars, when you have ten users with 2 char usernames) will cause lots of problems.
I found it: sso overrides username prevents the name change.
I still consider this situation a bug. Enabling this setting should either hide the Change Username button from the administrator panel and disable the users/.../preferences/username page, or still allow username changes for admins (possibly with a warning).
Iād prefer the latter, to allow admins to manually āuntangleā cases where Discourseās change-illegal-names-system has created unintended names.
Este PR adiciona casos de teste para o problema descrito no OP, para que possamos ter certeza de que, em geral, a sobrescrita do nome de usuƔrio, por exemplo, de jb1 para jb, funciona: