diff --git a/extend.php b/extend.php index 926568e..cebf87a 100644 --- a/extend.php +++ b/extend.php @@ -31,6 +31,7 @@ return [ (new Extend\Routes('api')) ->get('/oauth-clients', 'oauth.clients.list', Api\Controller\ListClientController::class) ->post('/oauth-clients', 'oauth.clients.create', Api\Controller\CreateClientController::class) + ->get('/oauth-clients/{client_id}', 'oauth.clients.show', Api\Controller\ShowClientController::class) ->patch('/oauth-clients/{id}', 'oauth.clients.update', Api\Controller\UpdateClientController::class) ->delete('/oauth-clients/{id}', 'oauth.clients.delete', Api\Controller\DeleteClientController::class), diff --git a/js/dist/forum.js b/js/dist/forum.js index d05dddc..7564cab 100644 Binary files a/js/dist/forum.js and b/js/dist/forum.js differ diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 1b1cfe4..cef956e 100644 Binary files a/js/dist/forum.js.map and b/js/dist/forum.js.map differ diff --git a/js/src/forum/components/oauth/AuthorizePage.js b/js/src/forum/components/oauth/AuthorizePage.js index ee48f3c..467eeb8 100644 --- a/js/src/forum/components/oauth/AuthorizePage.js +++ b/js/src/forum/components/oauth/AuthorizePage.js @@ -20,8 +20,9 @@ export default class AuthorizePage extends IndexPage { m.route.set('/'); } else { this.params = params; - app.store.find('oauth-clients', {'client_id': params.client_id}).then(client => { + app.store.find('oauth-clients', params.client_id).then(client => { this.client = client; + console.log(client); }); } } diff --git a/src/Api/Controller/ShowClientController.php b/src/Api/Controller/ShowClientController.php index 3b88c8d..2b662d7 100644 --- a/src/Api/Controller/ShowClientController.php +++ b/src/Api/Controller/ShowClientController.php @@ -16,10 +16,13 @@ class ShowClientController extends AbstractListController protected function data(ServerRequestInterface $request, Document $document) { $client_id = Arr::get($request->getQueryParams(), 'client_id'); - RequestUtil::getActor($request)->assertUser(); + RequestUtil::getActor($request)->assertRegistered(); $client = Client::whereOrFail('client_id', $client_id); - $client->client_secret = ''; + + if (isset($client->client_secret)) { + $client->client_secret = ''; + } return $client;