Add login account_id in validation response

This commit is contained in:
Akkadius 2019-08-10 07:04:52 -05:00
parent 66ee0dc9bd
commit 25a5310f49
3 changed files with 8 additions and 7 deletions

View File

@ -143,7 +143,7 @@ bool AccountManagement::CreateLoginserverWorldAdminAccount(
* @param in_account_password * @param in_account_password
* @return * @return
*/ */
bool AccountManagement::CheckLoginserverUserCredentials( uint32 AccountManagement::CheckLoginserverUserCredentials(
const std::string &in_account_username, const std::string &in_account_username,
const std::string &in_account_password, const std::string &in_account_password,
const std::string &source_loginserver const std::string &source_loginserver
@ -181,7 +181,7 @@ bool AccountManagement::CheckLoginserverUserCredentials(
source_loginserver source_loginserver
); );
return false; return 0;
} }
LogDebug( LogDebug(
@ -190,7 +190,7 @@ bool AccountManagement::CheckLoginserverUserCredentials(
source_loginserver source_loginserver
); );
return validated_credentials; return login_server_admin.id;
} }

View File

@ -54,7 +54,7 @@ public:
* @param in_account_password * @param in_account_password
* @return * @return
*/ */
static bool CheckLoginserverUserCredentials( static uint32 CheckLoginserverUserCredentials(
const std::string &in_account_username, const std::string &in_account_username,
const std::string &in_account_password, const std::string &in_account_password,
const std::string &source_loginserver = "local" const std::string &source_loginserver = "local"

View File

@ -114,13 +114,14 @@ namespace LoginserverWebserver {
return; return;
} }
bool credentials_valid = AccountManagement::CheckLoginserverUserCredentials( uint32 login_account_id = AccountManagement::CheckLoginserverUserCredentials(
username, username,
password password
); );
if (credentials_valid) { if (login_account_id > 0) {
response["message"] = "Credentials valid!"; response["message"] = "Credentials valid!";
response["data"]["account_id"] = login_account_id;
} }
else { else {
response["error"] = "Credentials invalid!"; response["error"] = "Credentials invalid!";