Merge pull request #1427 from gaincoder/main

check if the user of the session is in the database
This commit is contained in:
Diego Najar 2022-05-26 23:05:09 +02:00 committed by GitHub
commit 29563c8add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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->exists($username)) {
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;
}