mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-01 14:04:30 +02:00
Create a new DB user when somebody logs in using SAML
This commit is contained in:
parent
c0b74d83a5
commit
78ec0f1ea3
6 changed files with 75 additions and 18 deletions
|
@ -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'));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue