Skip to content

Commit

Permalink
Merge pull request #6054 from christianbeeznest/fixes-updates61
Browse files Browse the repository at this point in the history
User: Update last_login on user login
  • Loading branch information
christianbeeznest authored Jan 28, 2025
2 parents c3f6949 + a3b28a2 commit 71af734
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CoreBundle/EventListener/LoginSuccessHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ public function __invoke(InteractiveLoginEvent $event): ?RedirectResponse
$trackELoginRepository->createLoginRecord($user, new DateTime(), $userIp);
$trackEOnlineRepository->createOnlineSession($user, $userIp);

$user->setLastLogin(new DateTime());
$this->entityManager->persist($user);
$this->entityManager->flush();

// Log of connection attempts
$trackELoginRecordRepository->addTrackLogin($user->getUsername(), $userIp, true);
$this->loginAttemptLogger->logAttempt(true, $user->getUsername(), $userIp);
Expand Down

0 comments on commit 71af734

Please sign in to comment.