Disallow to perform oauth2 authentication for applications that have no corresponding type

This commit is contained in:
ErickSkrauch 2019-12-11 14:41:37 +03:00
parent 9da58beccf
commit f06354638e

View File

@ -37,7 +37,12 @@ class ClientRepository implements ClientRepositoryInterface {
}
private function findModel(string $id): ?OauthClient {
return OauthClient::findOne(['id' => $id]);
$client = OauthClient::findOne(['id' => $id]);
if ($client === null || $client->type !== OauthClient::TYPE_APPLICATION) {
return null;
}
return $client;
}
}