feat(extend): clients
This commit is contained in:
parent
5a8ea7f751
commit
54e7659d9f
9 changed files with 25 additions and 6 deletions
|
@ -27,6 +27,8 @@ return [
|
|||
|
||||
(new Extend\Routes('forum'))
|
||||
->post('/oauth/authorize', 'oauth.authorize.post', Controllers\AuthorizeController::class),
|
||||
(new Extend\Routes('api'))
|
||||
->get('/oauth/clients', 'oauth.clients.list', Api\Controller\ListClientController::class),
|
||||
|
||||
(new Extend\Middleware('api'))->add(ResourceScopeMiddleware::class),
|
||||
];
|
||||
|
|
BIN
js/dist/admin.js
generated
vendored
BIN
js/dist/admin.js
generated
vendored
Binary file not shown.
BIN
js/dist/admin.js.map
generated
vendored
BIN
js/dist/admin.js.map
generated
vendored
Binary file not shown.
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,7 +7,7 @@ export default class ClientsPage extends Page {
|
|||
oninit(vnode) {
|
||||
super.oninit(vnode);
|
||||
|
||||
app.store.find('clients').then(() => {
|
||||
app.store.find('oauth/clients').then(() => {
|
||||
m.redraw();
|
||||
});
|
||||
}
|
||||
|
|
7
js/src/common/extend.js
Normal file
7
js/src/common/extend.js
Normal file
|
@ -0,0 +1,7 @@
|
|||
import Extend from 'flarum/common/extenders';
|
||||
import Client from "./models/Client";
|
||||
|
||||
export default [
|
||||
new Extend.Store()
|
||||
.add('oauth-clients', Client),
|
||||
];
|
|
@ -1,5 +1 @@
|
|||
import app from 'flarum/common/app';
|
||||
|
||||
app.initializers.add('foskym/flarum-oauth-center', () => {
|
||||
console.log('[foskym/flarum-oauth-center] Hello, forum and admin!');
|
||||
});
|
||||
export { default as extend } from './extend';
|
||||
|
|
14
js/src/common/models/Client.js
Normal file
14
js/src/common/models/Client.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
import Model from 'flarum/common/Model';
|
||||
|
||||
export default class Client extends Model {
|
||||
client_id = Model.attribute('client_id');
|
||||
client_secret = Model.attribute('client_secret');
|
||||
redirect_uri = Model.attribute('redirect_uri');
|
||||
grant_types = Model.attribute('grant_types');
|
||||
scope = Model.attribute('scope');
|
||||
user_id = Model.attribute('user_id');
|
||||
client_name = Model.attribute('client_name');
|
||||
client_icon = Model.attribute('client_icon');
|
||||
client_desc = Model.attribute('client_desc');
|
||||
client_home = Model.attribute('client_home');
|
||||
}
|
Loading…
Reference in a new issue