Register: fix login regex.

master
Philippe Pittoli 2023-06-15 00:40:59 +02:00
parent 8bcae74efc
commit 719e47a28d
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ class AuthD::Request
return Response::ErrorAlreadyUsedLogin.new return Response::ErrorAlreadyUsedLogin.new
end 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 pattern = Regex.new acceptable_login_regex, Regex::Options::IGNORE_CASE
return Response::ErrorInvalidLoginFormat.new unless pattern =~ @login return Response::ErrorInvalidLoginFormat.new unless pattern =~ @login