diff --git a/src/Security/Login.cpp b/src/Security/Login.cpp index 17cc8bd..0e31604 100755 --- a/src/Security/Login.cpp +++ b/src/Security/Login.cpp @@ -19,7 +19,6 @@ std::string PrivateKey; extern bool LoginAuth; extern std::string Username; extern std::string UserRole; -std::string Role; void UpdateKey(const char* newKey){ if(newKey && std::isalnum(newKey[0])){ @@ -121,7 +120,12 @@ void CheckLocalKey(){ LoginAuth = true; UpdateKey(d["private_key"].get().c_str()); PublicKey = d["public_key"].get(); - Role = d["role"].get(); + if (d.contains("username")) { + Username = d["username"].get(); + } + if (d.contains("role")) { + UserRole = d["role"].get(); + } //info(Role); }else{ info("Auto-Authentication unsuccessful please re-login!");