mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2025-07-03 16:37:11 +00:00
store username and role on key login as well
This commit is contained in:
parent
aeb167c1e8
commit
9c7034e401
@ -19,7 +19,6 @@ std::string PrivateKey;
|
|||||||
extern bool LoginAuth;
|
extern bool LoginAuth;
|
||||||
extern std::string Username;
|
extern std::string Username;
|
||||||
extern std::string UserRole;
|
extern std::string UserRole;
|
||||||
std::string Role;
|
|
||||||
|
|
||||||
void UpdateKey(const char* newKey){
|
void UpdateKey(const char* newKey){
|
||||||
if(newKey && std::isalnum(newKey[0])){
|
if(newKey && std::isalnum(newKey[0])){
|
||||||
@ -121,7 +120,12 @@ void CheckLocalKey(){
|
|||||||
LoginAuth = true;
|
LoginAuth = true;
|
||||||
UpdateKey(d["private_key"].get<std::string>().c_str());
|
UpdateKey(d["private_key"].get<std::string>().c_str());
|
||||||
PublicKey = d["public_key"].get<std::string>();
|
PublicKey = d["public_key"].get<std::string>();
|
||||||
Role = d["role"].get<std::string>();
|
if (d.contains("username")) {
|
||||||
|
Username = d["username"].get<std::string>();
|
||||||
|
}
|
||||||
|
if (d.contains("role")) {
|
||||||
|
UserRole = d["role"].get<std::string>();
|
||||||
|
}
|
||||||
//info(Role);
|
//info(Role);
|
||||||
}else{
|
}else{
|
||||||
info("Auto-Authentication unsuccessful please re-login!");
|
info("Auto-Authentication unsuccessful please re-login!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user