fix: [users:view] Temporary measure to gracefully catch connection issue with keycloak

develop-unstable
Sami Mokaddem 2023-01-18 15:47:59 +01:00
parent 79a97efa70
commit 7cda322223
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
2 changed files with 7 additions and 2 deletions

View File

@ -154,7 +154,12 @@ class UsersController extends AppController
}
$keycloakUsersParsed = null;
if (!empty(Configure::read('keycloak.enabled'))) {
$keycloakUsersParsed = $this->Users->getParsedKeycloakUser();
try {
$keycloakUsersParsed = $this->Users->getParsedKeycloakUser();
} catch (\Exception $e) {
$keycloakUsersParsed = [];
$this->Flash->error(__('Issue while connecting to keycloak. {0}', $e->getMessage()));
}
}
$this->CRUD->view($id, [
'contain' => ['Individuals' => ['Alignments' => 'Organisations'], 'Roles', 'Organisations'],

View File

@ -459,7 +459,7 @@ class AuthKeycloakBehavior extends Behavior
$requireUpdate = true;
$differences = [
'user' => [
'keycloak' => 'USER NOT FOUND',
'keycloak' => __('ERROR or USER NOT FOUND'),
'cerebrate' => $user['username']
]
];