diff options
| author | Amlal El Mahrouss <amlal@nekernel.org> | 2025-11-17 10:05:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-17 10:05:07 +0100 |
| commit | 062c4bb508bf6ec7334d374fef2e0e10623b2df9 (patch) | |
| tree | 137a91eb22d1a9207fd4322ced08c3b6388c5eb5 /dev/kernel/src/UserMgr.cc | |
| parent | 36269e57831e560df6a0da9c9d02c00671b0163d (diff) | |
| parent | 791fcd646503f05617f22e6006c115095746da26 (diff) | |
Merge pull request #69 from nekernel-org/dev
release: NeKernel v0.0.7
Diffstat (limited to 'dev/kernel/src/UserMgr.cc')
| -rw-r--r-- | dev/kernel/src/UserMgr.cc | 13 |
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) { |
