Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions classes/SessionGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public function loginQuietly(Authenticatable $user)
{
$this->updatePersistSession($user);

$this->updatePasswordHashSession($user);

$this->updateSession($user->getAuthIdentifier());

$this->setUser($user);
Expand Down Expand Up @@ -130,6 +132,8 @@ protected function clearUserDataFromStorage()
{
$this->session->remove($this->getPersistCodeName());

$this->session->remove($this->getPasswordHashName());

parent::clearUserDataFromStorage();
}

Expand All @@ -148,4 +152,5 @@ public function getRecallerName()
{
return 'user_auth';
}

}
16 changes: 16 additions & 0 deletions classes/sessionguard/HasPersistence.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ protected function updatePersistSession(User $user)
return $this->session->put($this->getPersistCodeName(), $user->getPersistCode());
}

/**
* updatePasswordHashSession
*/
protected function updatePasswordHashSession(User $user)
{
return $this->session->put($this->getPasswordHashName(), $user->getAuthPassword());
}

/**
* hasValidPersistCode
*/
Expand All @@ -64,4 +72,12 @@ public function getPersistCodeName()
{
return 'user_persist_code';
}

/**
* getPasswordHashName gets the name of the session used to store the password
*/
public function getPasswordHashName()
{
return 'password_hash_' . $this->name;
}
}