Skip to content

Commit

Permalink
Oprava přihlášení pro přidané účastníky 2 (#939)
Browse files Browse the repository at this point in the history
* group user login fix

* cs fix
  • Loading branch information
jan-stanek committed Feb 14, 2023
1 parent 906fe43 commit aa8c23b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Services/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ public function authenticate(string $user, string $password): SimpleIdentity
{
$skautISUser = $this->skautIsService->getUserDetail();

$user = $this->userRepository->findBySkautISUserId($skautISUser->ID) ?? $this->userRepository->findBySkautISPersonId($skautISUser->ID_Person);
$user = $this->userRepository->findBySkautISUserId($skautISUser->ID);

$firstLogin = false;
if ($user === null) {
$user = new User();
// nacten ze skautIS pres skupinu
$user = $this->userRepository->findBySkautISPersonId($skautISUser->ID_Person) ?? new User();
$roleNonregistered = $this->roleRepository->findBySystemName(Role::NONREGISTERED);
$user->addRole($roleNonregistered);
$firstLogin = true;
Expand Down

0 comments on commit aa8c23b

Please sign in to comment.