From 459a361fd6d0e4393a62e2f39e1417be13ff35c0 Mon Sep 17 00:00:00 2001 From: Demian Katz Date: Thu, 25 Jan 2024 08:10:26 -0500 Subject: [PATCH] Add comments. --- module/VuFind/src/VuFind/Auth/LoginTokenManager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php index 30881e7f05d..c132205d5fc 100644 --- a/module/VuFind/src/VuFind/Auth/LoginTokenManager.php +++ b/module/VuFind/src/VuFind/Auth/LoginTokenManager.php @@ -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 { @@ -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;