fix: replace ß with ss in normalizeUserName (#7817)

When using an oauth provider for login, we can't always make sure that only supported characters are included in the name. Therefore there exist normalization rules for the username. In German some names contain the `ß` letter which usually gets replaces by `ss`. Therefore I added this to the `customCharsReplacement` list.
Without this fix, the user gets an undescriptive internal server error and the log states `CreateUser: name is invalid [<name>]: must be valid alpha or numeric or dash(-_) or dot characters`.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7817
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Daniel Kilimnik <daniel@neodyme.io>
Co-committed-by: Daniel Kilimnik <daniel@neodyme.io>
This commit is contained in:
Daniel Kilimnik 2025-05-08 16:59:41 +00:00 committed by David Rotermund
parent 14aeb69846
commit 5f67b72cdd
2 changed files with 2 additions and 1 deletions

View file

@ -645,6 +645,7 @@ func Test_NormalizeUserFromEmail(t *testing.T) {
{"test", "test", true},
{"Sinéad.O'Connor", "Sinead.OConnor", true},
{"Æsir", "AEsir", true},
{"Flußpferd", "Flusspferd", true},
// \u00e9\u0065\u0301
{"éé", "ee", true},
{"Awareness Hub", "Awareness-Hub", true},