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 Apr 5, 2023
1 parent 30f9a7d commit 14ac932
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 14ac932

Please sign in to comment.