mirror of
https://github.com/plankanban/planka.git
synced 2026-02-24 19:08:59 +03:00
Underscore on username #831
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @intersecato on GitHub (Oct 6, 2025).
I noticed that you can't create users whose usernames end with an underscore. Is this a design choice for some reason, or is it a bug? Even just logging in with OIDC results in a generic error.
@nastyagrifon commented on GitHub (Oct 7, 2025):
Can confirm that entering username with underscore at the end and pressing "Add user" does not create the user. Happens only with username.
ghcr.io/plankanban/planka:2.0.0-rc.4@intersecato commented on GitHub (Oct 7, 2025):
I also noticed that the username can't even begin with an underscore, not just at the end.
@kekekuli commented on GitHub (Oct 9, 2025):
I looked up the source code for validating the form of adding user, the logic is under the file validator.js in utils folder. You can see the regex here
const USERNAME_REGEX = /^[a-zA-Z0-9]+((_|\.)?[a-zA-Z0-9])*$/;Planka is using this regex to test if the username avaliable. The regex don't allow underscore stand at start or end.
So the conclude is that this is a design choice
@kekekuli commented on GitHub (Oct 9, 2025):
I think there would easily cause confuse like this issue due to currently have not sensiable tips to tell user what's wrong. Currently, the only feedback PLANKA provide is to put the focus to the field that failed validation. @meltyshev
@kekekuli commented on GitHub (Oct 9, 2025):
Even the focus feedback have not vibrant color like red.
@intersecato commented on GitHub (Oct 9, 2025):
But is there exactly a concrete reason why this was chosen? Do accounts with an underscore at the beginning or end cause problems? It was precisely the lack of valid error messages that made me think it wasn't intentional.
@kekekuli commented on GitHub (Oct 9, 2025):
Yeah. I agree with you, but I don't know the motivation, may be meltyshev will give the answer.
Lack of valid error messages, you said, that is the problem
@meltyshev commented on GitHub (Oct 9, 2025):
Hey! Sorry for the late reply. The username format was initially chosen without considering that OIDC would be introduced later, so yes - it's a bit outdated and we can update it. We might even consider removing the validation at the model level so it can accept any username coming from the provider, but we'll need to test this first. Also, I completely agree - there's definitely a lack of error messages in the OIDC process.
@intersecato commented on GitHub (Oct 15, 2025):
If possible, we'd be very happy. There are many users in our community whose usernames begin or end with an underscore who are currently blocked.
@meltyshev commented on GitHub (Oct 15, 2025):
I just made it less strict (
/^[a-z0-9._-]*$/) at the model level. Didn't want to remove the format validation entirely, since that could cause bugs - for example, if a username contains an@symbol.You can try updating to the
nightlyversion so you don't have to wait for the final v2 release - just don't forget to switch back to the stable one once it's ready.