mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Disallow to perform oauth2 authentication for applications that have no corresponding type
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user