From fc3c4873e5b77c6def09ef43ae48f507e6a89ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Thu, 26 Dec 2024 15:01:36 -0800 Subject: [PATCH] doc: add note regarding validateUsername --- internal/validator/user.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/validator/user.go b/internal/validator/user.go index 53220148..1ee3d087 100644 --- a/internal/validator/user.go +++ b/internal/validator/user.go @@ -153,6 +153,10 @@ func validatePassword(password string) *locale.LocalizedError { // validateUsername return an error if the `username` argument contains // a character that isn't alphanumerical nor `_` and `-`. +// +// Note: this validation should not be applied to previously created usernames, +// and cannot be applied to Google/OIDC accounts creation because the email +// address is used for the username field. func validateUsername(username string) *locale.LocalizedError { if strings.ContainsFunc(username, func(r rune) bool { if unicode.IsLetter(r) || unicode.IsNumber(r) {