mirror of
https://github.com/elyby/accounts.git
synced 2024-12-25 22:59:53 +05:30
Disallow to perform oauth2 authentication for applications that have no corresponding type
This commit is contained in:
parent
9da58beccf
commit
f06354638e
@ -37,7 +37,12 @@ class ClientRepository implements ClientRepositoryInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function findModel(string $id): ?OauthClient {
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user