Skip to content

Commit

Permalink
User: Update last_login on user login
Browse files Browse the repository at this point in the history
  • Loading branch information
christianbeeznest committed Jan 28, 2025
1 parent c3f6949 commit a3b28a2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CoreBundle/EventListener/#SuccessHandler.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 a3b28a2

Please # to comment.