mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
Add login account_id in validation response
This commit is contained in:
parent
66ee0dc9bd
commit
25a5310f49
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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"
|
||||||
|
|||||||
@ -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!";
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user