-
Notifications
You must be signed in to change notification settings - Fork 3
/
extend.php
29 lines (21 loc) · 907 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
<?php
namespace TokenJenny\Web3;
use Flarum\Extend;
use Flarum\Api\Serializer\BasicUserSerializer;
use TokenJenny\Web3\Api\Controllers;
use TokenJenny\Web3\Api\UserAttributes;
return [
(new Extend\Frontend('forum'))
->css(__DIR__.'/resources/less/forum/extension.less')
->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'))
->post('/tokenjenny/web3/connect', 'tokenjenny.web3.connect', Controllers\ConnectController::class)
->post('/tokenjenny/web3/login', 'tokenjenny.web3.login', Controllers\LoginController::class),
(new Extend\ApiSerializer(BasicUserSerializer::class))
->attributes(UserAttributes::class),
(new Extend\User())
->registerPreference('discloseWeb3Address', 'boolval', true),
];