Skip to content

Commit

Permalink
Fix optional JWKS route in DiscoveryController
Browse files Browse the repository at this point in the history
  • Loading branch information
christiaangoossens authored Apr 26, 2024
1 parent 3e4b2b9 commit 7115514
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Laravel/DiscoveryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public function __invoke(Request $request)
'issuer' => url('/'),
'authorization_endpoint' => route('passport.authorizations.authorize'),
'token_endpoint' => route('passport.token'),
'jwks_uri' => route('openid.jwks'),
'response_types_supported' => [
'code',
'token',
Expand Down Expand Up @@ -41,6 +40,10 @@ public function __invoke(Request $request)
$response['userinfo_endpoint'] = route('openid.userinfo');
}

if (Route::has('openid.jwks')) {
$response['jwks_uri'] = route('openid.jwks');
}

return response()->json($response, 200, [], JSON_PRETTY_PRINT);
}
}

0 comments on commit 7115514

Please sign in to comment.