mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-12 02:11:00 +01:00
Create a new DB user when somebody logs in using SAML
This commit is contained in:
@@ -57,10 +57,11 @@ final class LoginSuccessSubscriber implements EventSubscriberInterface
|
||||
$ip = $event->getRequest()->getClientIp();
|
||||
$log = new UserLoginLogEntry($ip, $this->gpdr_compliance);
|
||||
$user = $event->getAuthenticationToken()->getUser();
|
||||
if ($user instanceof User) {
|
||||
if ($user instanceof User && $user->getID()) {
|
||||
$log->setTargetElement($user);
|
||||
$this->eventLogger->logAndFlush($log);
|
||||
}
|
||||
$this->eventLogger->logAndFlush($log);
|
||||
|
||||
|
||||
$this->flashBag->add('notice', $this->translator->trans('flash.login_successful'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user