fix not returning error from Login, remove old code

This commit is contained in:
Lion Kortlepel 2024-02-09 15:54:02 +01:00 committed by Lion
parent 9dcfa1dca4
commit 8c9d3a5455
2 changed files with 2 additions and 2 deletions

View File

@ -14,6 +14,7 @@
#include <ws2tcpip.h>
#include "Startup.h"
#include "Logger.h"
#include <nlohmann/json.hpp>
#include <charconv>
#include <thread>
#include <set>
@ -138,7 +139,6 @@ void Parse(std::string Data,SOCKET CSocket){
Auth["role"] = UserRole;
}
Data = Auth.dump();
Data = "N{\"Auth\":"+std::to_string(LoginAuth)+",\"username\":\"" + Username + "\",\"role\":\"" + UserRole + "\"}";
}else{
Data = "N" + Login(Data.substr(Data.find(':') + 1));
}

View File

@ -89,7 +89,7 @@ std::string Login(const std::string& fields){
}
return GetFail("Invalid message parsing!");
} catch (const std::exception& e) {
error(e.what());
return GetFail(e.what());
}
}