Merge pull request #69 from SengokuNadeko/master

Adjustments made to regex
This commit is contained in:
CPunch 2020-09-06 14:06:37 -05:00 committed by GitHub
commit 458843958b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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