summaryrefslogtreecommitdiffhomepage
path: root/dev/kernel/src/UserMgr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dev/kernel/src/UserMgr.cc')
-rw-r--r--dev/kernel/src/UserMgr.cc13
1 files changed, 5 insertions, 8 deletions
diff --git a/dev/kernel/src/UserMgr.cc b/dev/kernel/src/UserMgr.cc
index 5ee2aa33..103e8ec9 100644
--- a/dev/kernel/src/UserMgr.cc
+++ b/dev/kernel/src/UserMgr.cc
@@ -2,7 +2,7 @@
* ========================================================
*
* NeKernel
- * Copyright (C) 2024-2025, Amlal El Mahrouss, all rights reserved.
+ * Copyright (C) 2024-2025, Amlal El Mahrouss, licensed under the Apache 2.0 license.
*
* File: UserMgr.cc
* Purpose: User Manager, used to provide authentication and security.
@@ -89,14 +89,11 @@ Bool User::Save(const UserPublicKey password) noexcept {
Bool User::Login(const UserPublicKey password) noexcept {
if (!password || !*password) return No;
- // now check if the password matches.
- if (this->mUserFNV == Detail::user_fnv_generator(password, this)) {
- kout << "User::Login: Password matches.\r";
- return Yes;
- }
+ auto ret = this->mUserFNV == Detail::user_fnv_generator(password, this);
- kout << "User::Login: Password doesn't match.\r";
- return No;
+ // now check if the password matches.
+ kout << (ret ? "User::Login: Password matches.\r" : "User::Login: Password doesn't match.\r");
+ return ret;
}
Bool User::operator==(const User& lhs) {