Explorar o código

doc: add note regarding validateUsername

Frédéric Guillot hai 1 ano
pai
achega
fc3c4873e5
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      internal/validator/user.go

+ 4 - 0
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) {