feat(TOTP): use feature toggle via authserver.conf (#5978)

* Revert "Revert "feat(Core/Auth): add AccountInfo helper (#5640)" (#5971)"

This reverts commit fe6db2ff96.

* feat(TOTP): use feature toggle via authserver.conf

* chore(wip): wip

* Update src/server/authserver/authserver.conf.dist

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>

Co-authored-by: Kitzunu <24550914+Kitzunu@users.noreply.github.com>
This commit is contained in:
Francesco Borzì
2021-05-21 09:56:52 +02:00
committed by GitHub
parent 983d4b5771
commit aab32e5f30
6 changed files with 398 additions and 395 deletions

View File

@@ -14,6 +14,7 @@
#include "SRP6.h"
class ACE_INET_Addr;
class Fields;
struct Realm;
enum eStatus
@@ -26,6 +27,21 @@ enum eStatus
STATUS_CLOSED
};
struct AccountInfo
{
void LoadResult(Field* fields);
uint32 Id = 0;
std::string Login;
bool IsLockedToIP = false;
std::string LockCountry;
std::string LastIP;
uint32 FailedLogins = 0;
bool IsBanned = false;
bool IsPermanenetlyBanned = false;
AccountTypes SecurityLevel = SEC_PLAYER;
};
// Handle login commands
class AuthSocket: public RealmSocket::Session
{
@@ -65,7 +81,7 @@ private:
eStatus _status;
std::string _login;
AccountInfo _accountInfo;
Optional<std::vector<uint8>> _totpSecret;
// Since GetLocaleByName() is _NOT_ bijective, we have to store the locale as a string. Otherwise we can't differ
@@ -74,7 +90,6 @@ private:
std::string _os;
uint16 _build;
uint8 _expversion;
AccountTypes _accountSecurityLevel;
};
#endif