forward user's role on login

This commit is contained in:
Lion Kortlepel
2024-02-09 15:09:41 +01:00
committed by Lion
parent 7967ec38e8
commit aeb167c1e8
2 changed files with 6 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ std::string PublicKey;
std::string PrivateKey;
extern bool LoginAuth;
extern std::string Username;
extern std::string UserRole;
std::string Role;
void UpdateKey(const char* newKey){
@@ -69,6 +70,9 @@ std::string Login(const std::string& fields){
if (d.contains("username")) {
Username = d["username"].get<std::string>();
}
if (d.contains("role")) {
UserRole = d["role"].get<std::string>();
}
if(d.contains("private_key")) {
UpdateKey(d["private_key"].get<std::string>().c_str());
}