diff --git a/src/Security/Login.cpp b/src/Security/Login.cpp index 7b12f37..ce286b1 100755 --- a/src/Security/Login.cpp +++ b/src/Security/Login.cpp @@ -18,7 +18,7 @@ extern bool LoginAuth; std::string Role; void UpdateKey(const char* newKey){ - if(newKey){ + if(newKey && std::isalnum(newKey[0])){ std::ofstream Key("key"); if(Key.is_open()){ Key << newKey; @@ -88,6 +88,13 @@ void CheckLocalKey(){ Key.read(&Buffer[0], Size); Key.close(); + for (char& c : Buffer) { + if (!std::isalnum(c) && c != '-') { + UpdateKey(""); + return; + } + } + Buffer = HTTP::Post("https://auth.beammp.com/userlogin", R"({"pk":")" + Buffer + "\"}"); json::Document d;