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 {
|
export default class AuthorizePage extends IndexPage {
|
||||||
params = [];
|
params = [];
|
||||||
|
client = null;
|
||||||
oninit(vnode) {
|
oninit(vnode) {
|
||||||
super.oninit(vnode);
|
super.oninit(vnode);
|
||||||
if (!app.session.user) {
|
if (!app.session.user) {
|
||||||
|
@ -19,7 +20,9 @@ export default class AuthorizePage extends IndexPage {
|
||||||
m.route.set('/');
|
m.route.set('/');
|
||||||
} else {
|
} else {
|
||||||
this.params = params;
|
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;
|
public $serializer = ClientSerializer::class;
|
||||||
protected function data(ServerRequestInterface $request, Document $document)
|
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();
|
RequestUtil::getActor($request)->assertUser();
|
||||||
|
|
||||||
$client = Client::findOrFail($id);
|
$client = Client::whereOrFail('client_id', $client_id);
|
||||||
$client->client_secret = '<PROTECT>';
|
$client->client_secret = '<PROTECT>';
|
||||||
|
|
||||||
return $client;
|
return $client;
|
||||||
|
|
Loading…
Reference in a new issue