Skip to content

Commit df2e3eb

Browse files
committed
added sanity check on registeredClient
1 parent efe77bc commit df2e3eb

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

lib/Server.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ public static function getConfigClient() {
6666
if ($clientId) {
6767
$registeredClient = ClientRegistration::getRegistration($clientId);
6868
}
69-
if (isset($registeredClient)) { //FIXME: $registeredClient may be false, what then?
69+
if (isset($registeredClient)) {
70+
if (!$registeredClient || !isset($registeredClient['redirect_uris'])) {
71+
//TODO: better to throw an error and handle that on the outside
72+
header("HTTP/1.1 400 Bad request");
73+
exit();
74+
}
7075
return new ConfigClient(
7176
$clientId,
7277
$registeredClient['client_secret'] ?? '',

0 commit comments

Comments
 (0)