forward user's role on login

This commit is contained in:
Lion Kortlepel authored and Lion committed 2024-02-24 20:26:26 +01:00
1 parent 7967ec38e8
commit aeb167c1e8
2 files changed
+6 -1

No files matched your search

+4
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());
}