Some GitHub usernames cause internal server errors without any info during first login #2

Open
opened 2025-05-08 23:11:22 +00:00 by magneticflux0 · 1 comment

On GitHub and https://identity.lix.systems/, my username is magneticflux-, with a trailing hyphen. Logging in to Forgejo for the first time resulted in an internal server exception with no details. Using a little intuition, I changed my username on https://identity.lix.systems/ to magneticflux0, was able to log in to Forgejo, and then changed it back.

Having a trailing hyphen in my username makes me a magnet for validation bugs all over the login stack, so I'm not sure exactly which part of the system is causing the issue. Upstream, on Codeberg, trying to create an account from GitHub asks for a username explicitly, and returns this error when using my name:

Username can only contain alphanumeric chars ("0-9","a-z","A-Z"), dash ("-") and underscore ("_"). It cannot begin or end with non-alphanumeric chars, and consecutive non-alphanumeric chars are also forbidden.

The consecutive non-alphanumeric character restriction is particularly funny, I don't think I've seen that before.

I don't expect the username validation to be changed, but the OAuth provider or whatever is creating the accounts should at least give a helpful error. If this is actually an upstream bug in Forgejo's new account creation flow, I apologize for bothering you!

On GitHub and https://identity.lix.systems/, my username is `magneticflux-`, with a trailing hyphen. Logging in to Forgejo for the first time resulted in an internal server exception with no details. Using a little intuition, I changed my username on https://identity.lix.systems/ to `magneticflux0`, was able to log in to Forgejo, and then changed it back. Having a trailing hyphen in my username makes me a magnet for validation bugs all over the login stack, so I'm not sure exactly which part of the system is causing the issue. Upstream, on Codeberg, trying to create an account from GitHub asks for a username explicitly, and returns this error when using my name: > Username can only contain alphanumeric chars ("0-9","a-z","A-Z"), dash ("-") and underscore ("_"). It cannot begin or end with non-alphanumeric chars, and consecutive non-alphanumeric chars are also forbidden. The consecutive non-alphanumeric character restriction is particularly funny, I don't think I've seen that before. I don't expect the username validation to be changed, but the OAuth provider or whatever is creating the accounts should at least give a helpful error. If this is actually an upstream bug in Forgejo's new account creation flow, I apologize for bothering you!
Owner

Hi! Sorry for not responding sooner, I somehow missed this.

This does sound like an upstream bug to me.
I think you provided all the information I need, thanks for that.
I intend to fix this upstream, I just can't provide you with a timeline for when that will happen right now.

Hi! Sorry for not responding sooner, I somehow missed this. This does sound like an upstream bug to me. I think you provided all the information I need, thanks for that. I intend to fix this upstream, I just can't provide you with a timeline for when that will happen right now.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: the-distro/nix-forgejo#2
No description provided.