Register: fix login regex.

This commit is contained in:
Philippe Pittoli 2023-06-15 00:40:59 +02:00
parent 8bcae74efc
commit 719e47a28d

View File

@ -17,7 +17,7 @@ class AuthD::Request
return Response::ErrorAlreadyUsedLogin.new
end
acceptable_login_regex = "[a-zA-Z][a-zA-Z0-9 _-']+"
acceptable_login_regex = "[a-zA-Z][-_ a-zA-Z0-9']+"
pattern = Regex.new acceptable_login_regex, Regex::Options::IGNORE_CASE
return Response::ErrorInvalidLoginFormat.new unless pattern =~ @login