forum-oauth-center/extend.php

35 lines
1 KiB
PHP
Raw Normal View History

2023-09-28 17:42:13 +08:00
<?php
/*
* This file is part of foskym/flarum-oauth-center.
*
* Copyright (c) 2023 FoskyM.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace FoskyM\OAuthCenter;
use Flarum\Extend;
2023-09-29 14:47:36 +08:00
use FoskyM\OAuthCenter\Middlewares\ResourceScopeMiddleware;
2023-09-28 17:42:13 +08:00
return [
(new Extend\Frontend('forum'))
->js(__DIR__.'/js/dist/forum.js')
2023-09-29 14:47:36 +08:00
->css(__DIR__.'/less/forum.less')
->route('/oauth/authorize', 'oauth.authorize'),
2023-09-28 17:42:13 +08:00
(new Extend\Frontend('admin'))
->js(__DIR__.'/js/dist/admin.js')
->css(__DIR__.'/less/admin.less'),
new Extend\Locales(__DIR__.'/locale'),
2023-09-29 14:47:36 +08:00
(new Extend\Routes('forum'))
->post('/oauth/authorize', 'oauth.authorize.post', Controllers\AuthorizeController::class),
2023-09-29 22:25:55 +08:00
(new Extend\Routes('api'))
2023-09-30 09:55:35 +08:00
->get('/oauth-clients', 'oauth.clients.list', Api\Controller\ListClientController::class),
2023-09-29 14:47:36 +08:00
(new Extend\Middleware('api'))->add(ResourceScopeMiddleware::class),
2023-09-28 17:42:13 +08:00
];