Преглед изворни кода

doc: add note regarding validateUsername

Frédéric Guillot пре 1 година
родитељ
комит
fc3c4873e5
1 измењених фајлова са 4 додато и 0 уклоњено
  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) {