fix: [keycloak status] - handle gracefully if user not found in KC
- As reported by Matúš Mikuláš, Adam Gajdošík, Milan Pikula of SK-CERTdevelop-unstable
parent
a5eb016fc4
commit
13bb031167
|
@ -455,7 +455,17 @@ class AuthKeycloakBehavior extends Behavior
|
|||
$user['meta_fields'] = $temp;
|
||||
$differences = [];
|
||||
$keycloakUser = $keycloakUsersParsed[$username] ?? [];
|
||||
$requireUpdate = $this->checkKeycloakUserRequiresUpdate($keycloakUser, $user, $differences);
|
||||
if (empty($keycloakUser)) {
|
||||
$requireUpdate = true;
|
||||
$differences = [
|
||||
'user' => [
|
||||
'keycloak' => 'USER NOT FOUND',
|
||||
'cerebrate' => $user['username']
|
||||
]
|
||||
];
|
||||
} else {
|
||||
$requireUpdate = $this->checkKeycloakUserRequiresUpdate($keycloakUser, $user, $differences);
|
||||
}
|
||||
$status[$user['id']] = [
|
||||
'require_update' => $requireUpdate,
|
||||
'differences' => $differences,
|
||||
|
|
Loading…
Reference in New Issue