Small regex fix

Old regex had some problems (a bit too restrictive). If you want, you can push this to loosen up the restrictions a little.
This commit is contained in:
SengokuNadeko 2020-09-05 14:34:46 -04:00 committed by CakeLancelot
parent e936cb9fac
commit 3876e0537e

View File

@ -398,8 +398,8 @@ bool CNLoginServer::exitDuplicate(int accountId)
}
bool CNLoginServer::isLoginDataGood(std::string login, std::string password)
{
std::regex loginRegex("^([A-Za-z\\d_\\-]){5,20}$");
std::regex passwordRegex("^([A-Za-z\\d_\\-@$!%*#?&,.+:;<=>]){8,20}$");
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}$");
return (std::regex_match(login, loginRegex) && std::regex_match(password, passwordRegex));
}
bool CNLoginServer::isPasswordCorrect(std::string actualPassword, std::string tryPassword)