-
Notifications
You must be signed in to change notification settings - Fork 1
/
extend.php
31 lines (23 loc) · 1.04 KB
/
extend.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
namespace ClarkWinkelmann\JWTCookieLogin;
use ClarkWinkelmann\JWTCookieLogin\Middleware\AuthenticateWithJWT;
use Flarum\Api\Serializer\ForumSerializer;
use Flarum\Extend;
use Flarum\Http\Middleware\AuthenticateWithSession;
return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
new Extend\Locales(__DIR__ . '/resources/locale'),
(new Extend\Routes('api'))
->patch('/jwt/users/{id}', 'jwt-cookie-login.users.update', Controller\EditUserController::class),
(new Extend\Middleware('forum'))
->insertAfter(AuthenticateWithSession::class, AuthenticateWithJWT::class),
(new Extend\Middleware('admin'))
->insertAfter(AuthenticateWithSession::class, AuthenticateWithJWT::class),
(new Extend\Middleware('api'))
->insertAfter(AuthenticateWithSession::class, AuthenticateWithJWT::class),
(new Extend\ApiSerializer(ForumSerializer::class))
->attributes(ForumAttributes::class),
];