feat: improved handling of roles determination from bpn api response
This commit is contained in:
1 parent
c96e1e6f61
commit
f437e03374
2 files changed
+18
No files matched your search
@@ -118,6 +118,13 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
||||
|
||||
// User is expected to have at least one role
|
||||
if (0 === count($roles)) {
|
||||
// Revoke roles on existing local user to invalidate any active session
|
||||
$existingUser = $this->userDataHandler->findLocalUser($profileResponse);
|
||||
if (null !== $existingUser) {
|
||||
$existingUser->setRoles([]);
|
||||
$this->entityManager->flush();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user