diff --git a/js/dist/forum.js b/js/dist/forum.js index 83ca55c..d05dddc 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 28515cd..1b1cfe4 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 30fd7a4..ee48f3c 100644 --- a/js/src/forum/components/oauth/AuthorizePage.js +++ b/js/src/forum/components/oauth/AuthorizePage.js @@ -7,6 +7,7 @@ import extractText from 'flarum/common/utils/extractText'; export default class AuthorizePage extends IndexPage { params = []; + client = null; oninit(vnode) { super.oninit(vnode); if (!app.session.user) { @@ -19,7 +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 => { + this.client = client; + }); } } diff --git a/src/Api/Controller/ShowClientController.php b/src/Api/Controller/ShowClientController.php index 39adda5..3b88c8d 100644 --- a/src/Api/Controller/ShowClientController.php +++ b/src/Api/Controller/ShowClientController.php @@ -15,10 +15,10 @@ class ShowClientController extends AbstractListController public $serializer = ClientSerializer::class; protected function data(ServerRequestInterface $request, Document $document) { - $id = Arr::get($request->getQueryParams(), 'id'); + $client_id = Arr::get($request->getQueryParams(), 'client_id'); RequestUtil::getActor($request)->assertUser(); - $client = Client::findOrFail($id); + $client = Client::whereOrFail('client_id', $client_id); $client->client_secret = ''; return $client;