diff --git a/src/Network/Login.cpp b/src/Network/Login.cpp index 99141ed..166ccd3 100644 --- a/src/Network/Login.cpp +++ b/src/Network/Login.cpp @@ -9,7 +9,7 @@ #include "Logger.h" void UpdateKey(const std::string& newKey) { - if (!newKey.empty()) { + if (!newKey.empty() && std::isalnum(newKey[0])) { std::ofstream Key("key"); if (Key.is_open()) { Key << newKey; diff --git a/src/gui/Gui.cpp b/src/gui/Gui.cpp index f22b15d..bdcaa7e 100644 --- a/src/gui/Gui.cpp +++ b/src/gui/Gui.cpp @@ -379,7 +379,9 @@ void CheckKey() { Json d = Json::parse(Buffer, nullptr, false); if (Buffer == "-1" || Buffer.at(0) != '{' || d.is_discarded()) { + LOG(ERROR) << Buffer; wxMessageBox("Couldn't connect to auth server, you might be offline!", "Warning", wxICON_WARNING); + UpdateKey(""); return; } if (d["success"].get()) {