<listenerclassname>wcf\system\event\listener\UserLinkHtmlInputNodeProcessorListener</listenerclassname>
<environment>all</environment>
</eventlistener>
+ <eventlistener name="userLoginCancelLostPassword">
+ <eventclassname>wcf\system\user\authentication\event\UserLoggedIn</eventclassname>
+ <listenerclassname>wcf\system\event\listener\UserLoginCancelLostPasswordListener</listenerclassname>
+ <environment>all</environment>
+ </eventlistener>
</import>
</data>
--- /dev/null
+<?php
+
+namespace wcf\system\event\listener;
+
+use wcf\data\user\UserAction;
+use wcf\system\user\authentication\event\UserLoggedIn;
+
+/**
+ * Cancels lost password requests if the user successfully logs in.
+ *
+ * @author Tim Duesterhus
+ * @copyright 2001-2021 WoltLab GmbH
+ * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package WoltLabSuite\Core\System\Event\Listener
+ * @since 5.5
+ */
+final class UserLoginCancelLostPasswordListener
+{
+ public function __invoke(UserLoggedIn $event)
+ {
+ $user = $event->getUser();
+ if (!$user->lostPasswordKey) {
+ return;
+ }
+
+ (new UserAction(
+ [$user],
+ 'update',
+ [
+ 'data' => [
+ 'lastLostPasswordRequestTime' => 0,
+ 'lostPasswordKey' => '',
+ ],
+ ]
+ ))->executeAction();
+ }
+}