fix: [authKeycloakBehavior] Added missing association preventing user to log via keycloak

cli-modification-summary
Sami Mokaddem 2022-09-21 10:07:51 +02:00
parent 69fee02498
commit 2c87b1e500
No known key found for this signature in database
GPG Key ID: 164C473F627A06FA
1 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,10 @@ class AuthKeycloakBehavior extends Behavior
$fields[$field] = $mapping[$field]; $fields[$field] = $mapping[$field];
} }
} }
$existingUser = $this->_table->find()->where(['username' => $profile_payload[$fields['username']]])->first(); $existingUser = $this->_table->find()
->where(['username' => $profile_payload[$fields['username']]])
->contain('Individuals')
->first();
if ($existingUser['individual']['email'] !== $profile_payload[$fields['email']]) { if ($existingUser['individual']['email'] !== $profile_payload[$fields['email']]) {
return false; return false;
} }