-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
extend.php
30 lines (23 loc) · 841 Bytes
/
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
<?php
/*
* This file is part of davwheat/session-keepalive.
*
* Copyright (c) 2022 David Wheatley.
*
* For the full copyright and license information, please view the LICENSE.md
* file that was distributed with this source code.
*/
namespace Davwheat\SessionKeepalive;
use Flarum\Extend;
return [
(new Extend\Frontend('forum'))
->js(__DIR__ . '/js/dist/forum.js'),
(new Extend\Frontend('admin'))
->js(__DIR__ . '/js/dist/admin.js'),
(new Extend\Routes('api'))
->post('/csrf-keepalive', 'davwheat-session-keepalive.csrf-keepalive', Api\Controller\RefreshCsrfToken::class),
(new Extend\Csrf())
->exemptRoute('davwheat-session-keepalive.csrf-keepalive'),
(new Extend\ApiSerializer(\Flarum\Api\Serializer\ForumSerializer::class))
->attributes(ForumAttributes::class),
];