Use 6 digit numbers for two factor code

This commit is contained in:
Vortrex
2022-07-23 04:20:11 -05:00
parent ab697557ef
commit e65cd0b4be

View File

@@ -1125,7 +1125,8 @@ function checkLogin(client, password) {
} }
if (doesPlayerHaveTwoFactorAuthEnabled(client) && checkForSMTPModule() && getEmailConfig().enabled) { if (doesPlayerHaveTwoFactorAuthEnabled(client) && checkForSMTPModule() && getEmailConfig().enabled) {
getPlayerData(client).twoFactorAuthCode = toUpperCase(generateRandomString(6)); //getPlayerData(client).twoFactorAuthCode = toUpperCase(generateRandomString(6));
getPlayerData(client).twoFactorAuthCode = getRandom(100000, 999999);
showPlayerTwoFactorAuthenticationGUI(client); showPlayerTwoFactorAuthenticationGUI(client);
sendAccountTwoFactorAuthCode(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerData(client).twoFactorAuthCode); sendAccountTwoFactorAuthCode(getPlayerData(client).accountData.emailAddress, getPlayerName(client), getPlayerData(client).twoFactorAuthCode);
return true; return true;
@@ -1736,7 +1737,8 @@ function setAccountEmailVerificationCode(accountData, emailVerificationCode) {
// =========================================================================== // ===========================================================================
function generateEmailVerificationCode() { function generateEmailVerificationCode() {
return generateRandomString(10); //return toUpperCase(generateRandomString(6));
return getRandom(100000, 999999);
} }
// =========================================================================== // ===========================================================================