From 2293c377eb886392ca09752fe1519e0087303a0f Mon Sep 17 00:00:00 2001 From: Andrew nuark G Date: Wed, 16 Dec 2020 00:24:51 +0700 Subject: [PATCH] Auth subsystem update --- system/auth_system.cpp | 6 +++--- system/auth_system.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/auth_system.cpp b/system/auth_system.cpp index e7432c1..6b2a0fb 100644 --- a/system/auth_system.cpp +++ b/system/auth_system.cpp @@ -1,8 +1,8 @@ #include "auth_system.h" -const user_entity& auth_system::get_user(const QString &login, bool &success) { - user_entity *out; +const user_entity* auth_system::get_user(const QString &login, bool &success) { + user_entity *out = nullptr; success = false; for (user_entity &item : this->_users) { @@ -13,7 +13,7 @@ const user_entity& auth_system::get_user(const QString &login, bool &success) { } } - return *out; + return out; } bool auth_system::remove_user(const QString &login) { diff --git a/system/auth_system.h b/system/auth_system.h index 9e442d5..b0f7cab 100644 --- a/system/auth_system.h +++ b/system/auth_system.h @@ -13,7 +13,7 @@ private: public: auth_system() = default; - const user_entity& get_user(const QString &login, bool &success); + const user_entity* get_user(const QString &login, bool &success); bool remove_user(const QString &login); bool register_user(const QString &login, const QString &password, UserRole role);