feat: get client info
This commit is contained in:
parent
7067581f44
commit
44584fb882
4 changed files with 6 additions and 3 deletions
BIN
js/dist/forum.js
generated
vendored
BIN
js/dist/forum.js
generated
vendored
Binary file not shown.
BIN
js/dist/forum.js.map
generated
vendored
BIN
js/dist/forum.js.map
generated
vendored
Binary file not shown.
|
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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 = '<PROTECT>';
|
||||
|
||||
return $client;
|
||||
|
|
Loading…
Reference in a new issue