force 2fa for group of users (#456)
Authored-by: Antonio Cordeddu <coranto@yetopen.com>
This commit is contained in:
@ -12,4 +12,4 @@ if (file_exists(__DIR__.'/db.local.php')) {
|
||||
$db = array_merge($db, require(__DIR__.'/db.local.php'));
|
||||
}
|
||||
|
||||
return $db;
|
||||
return $db;
|
||||
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Da\User\Filter\TwoFactorAuthenticationEnforceFilter;
|
||||
|
||||
return [
|
||||
'id' => 'yii2-user-tests',
|
||||
'basePath' => dirname(__DIR__),
|
||||
@ -47,4 +49,12 @@ return [
|
||||
],
|
||||
],
|
||||
'params' => [],
|
||||
'on beforeAction' => function() {
|
||||
Yii::$app->controller->attachBehavior(
|
||||
'enforceTwoFactorAuthentication',[
|
||||
'class' => TwoFactorAuthenticationEnforceFilter::class,
|
||||
'except' => ['login', 'logout','account','two-factor', 'two-factor-enable'],
|
||||
]
|
||||
);
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user