mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2024-11-05 06:50:04 +00:00
Adjustments to the regex
I made the regex a bit less restrictive. If you want, you can push this if it seems appropriate. Username should be at least 4 characters and max 32 Password should be at least 8 characters and max 32 Usernames can be any combination of letters and numbers, with no special characters except for dash and underscore. Passwords can use any of the alphanumeric/special characters specified in the regex.
This commit is contained in:
parent
3876e0537e
commit
361c069d0c
@ -398,8 +398,8 @@ bool CNLoginServer::exitDuplicate(int accountId)
|
||||
}
|
||||
bool CNLoginServer::isLoginDataGood(std::string login, std::string password)
|
||||
{
|
||||
std::regex loginRegex("^(?=.*[A-Za-z0-9]$)[A-Za-z][A-Za-z\d.-]{3,20}$");
|
||||
std::regex passwordRegex("^(?=.*[A-Za-z0-9]$)[A-Za-z][A-Za-z\d.-]{3,20}$");
|
||||
std::regex loginRegex("[a-zA-Z0-9_-]{4,32}");
|
||||
std::regex passwordRegex("[a-zA-Z0-9!@#$%^&*()_+]{8,32}");
|
||||
return (std::regex_match(login, loginRegex) && std::regex_match(password, passwordRegex));
|
||||
}
|
||||
bool CNLoginServer::isPasswordCorrect(std::string actualPassword, std::string tryPassword)
|
||||
|
Loading…
Reference in New Issue
Block a user