/
ext_localconf.php
executable file
·45 lines (40 loc) · 1.33 KB
/
ext_localconf.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
use Dpool\Gatedcontent\Service\TokenAuthService;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
ExtensionUtility::configurePlugin(
'Dpool.gatedcontent',
'gate',
array(
'Gate' => 'form, processForm, handleDoubleOptIn, handleAdminConfirmation, deliverGatedContent',
),
// non-cacheable actions
array(
'Gate' => 'form, processForm, handleDoubleOptIn, handleAdminConfirmation, deliverGatedContent',
)
);
// Use a custom cache to invalidate double opt-in tokens.
// See Controller\GateController::handleDoubleOptInAction().
if (!is_array($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tokencache'])) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['tokencache'] = [];
}
// Add the authentication service.
ExtensionManagementUtility::addService(
'gatedcontent',
'auth',
TokenAuthService::class,
[
'title' => 'JWT authentication',
'description' => 'Authenticates users by a JSON Web Token',
'subtype' => 'getUserFE,authUserFE',
'available' => true,
'priority' => 80,
'quality' => 80,
'os' => '',
'exec' => '',
'className' => TokenAuthService::class
]
);