Added checks for KC being enabled (#106)
Initialisation of Auth behaviour and enrollment of users in KC, was dependent on the presence of a `keycloak` section in config.json Added checks to ensure KC is configured as "enabled", rather than just checking if a keycloak config section was present.pull/107/head
parent
0537d05f53
commit
cf565484b9
|
@ -57,7 +57,9 @@ class UsersTable extends AppTable
|
|||
private function initAuthBehaviors()
|
||||
{
|
||||
if (!empty(Configure::read('keycloak'))) {
|
||||
$this->addBehavior('AuthKeycloak');
|
||||
if (Configure::read('keycloak.enabled')) {
|
||||
$this->addBehavior('AuthKeycloak');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +190,9 @@ class UsersTable extends AppTable
|
|||
public function enrollUserRouter($data): void
|
||||
{
|
||||
if (!empty(Configure::read('keycloak'))) {
|
||||
$this->enrollUser($data);
|
||||
if (Configure::read('keycloak.enabled')) {
|
||||
$this->enrollUser($data);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue