check if the user of the session is in the database

This commit is contained in:
Tim Moritz 2022-04-14 16:40:15 +02:00
parent f6899abfeb
commit 35826189ec

View file

@ -48,10 +48,10 @@ class Login {
{
if (Session::get('fingerPrint')===$this->fingerPrint()) {
$username = Session::get('username');
if (!empty($username)) {
if (!empty($username) && $this->users->getUserDB($username) !== false) {
return true;
} else {
Log::set(__METHOD__.LOG_SEP.'Session username empty, destroying the session.');
Log::set(__METHOD__.LOG_SEP.'Session username empty or user not found, destroying the session.');
Session::destroy();
return false;
}