Skip to content

Commit

Permalink
Add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
demiankatz authored Jan 25, 2024
1 parent 00e218b commit 459a361
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module/VuFind/src/VuFind/Auth/LoginTokenManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ public function tokenLogin(string $sessionId): ?\VuFind\Db\Row\User
// associated with the tokens and send a warning email to user
$user = $this->userTable->getById($cookie['user_id']);
$this->deleteUserLoginTokens($user->id);
// We can't send an email until after the theme has initialized;
// if it's not ready yet, save the user for later.
if ($this->themeInitialized) {
$this->sendLoginTokenWarningEmail($user);
} else {
Expand All @@ -183,6 +185,7 @@ public function tokenLogin(string $sessionId): ?\VuFind\Db\Row\User
public function themeIsReady(): void
{
$this->themeInitialized = true;
// If we have queued a user warning, we can send it now!
if ($this->userToWarn) {
$this->sendLoginTokenWarningEmail($this->userToWarn);
$this->userToWarn = null;
Expand Down

0 comments on commit 459a361

Please sign in to comment.