From 8c9d3a54558466562063c47d1df2d2c8b80bc410 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Fri, 9 Feb 2024 15:54:02 +0100 Subject: [PATCH] fix not returning error from Login, remove old code --- src/Network/Core.cpp | 2 +- src/Security/Login.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Network/Core.cpp b/src/Network/Core.cpp index d77ddf3..0f1139e 100755 --- a/src/Network/Core.cpp +++ b/src/Network/Core.cpp @@ -14,6 +14,7 @@ #include #include "Startup.h" #include "Logger.h" +#include #include #include #include @@ -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)); } diff --git a/src/Security/Login.cpp b/src/Security/Login.cpp index a14d831..1fec7f1 100755 --- a/src/Security/Login.cpp +++ b/src/Security/Login.cpp @@ -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()); } }