diff --git a/CHANGELOG.md b/CHANGELOG.md index 290e95b..7a0eed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # CHANGELOG ## 1.1.2 - Work in progress +- Enh #137: Added the ability to make `enableAutologin` configurable (pappfer) - Enh #135: Added Estonian translation (tonisormisson) - Bug #133: Fix user search returning no results in admin page (phiurs) - Bug #125: Fix validation in non-ajax requests (faenir) diff --git a/src/User/Bootstrap.php b/src/User/Bootstrap.php index 29403ae..48a6952 100644 --- a/src/User/Bootstrap.php +++ b/src/User/Bootstrap.php @@ -149,7 +149,7 @@ class Bootstrap implements BootstrapInterface $di->set( 'yii\web\User', [ - 'enableAutoLogin' => true, + 'enableAutoLogin' => $app->getModule('user')->enableAutologin, 'loginUrl' => ['/user/security/login'], 'identityClass' => $di->get(ClassMapHelper::class)->get(User::class), ] diff --git a/src/User/Module.php b/src/User/Module.php index 53b54b5..be4ac9b 100644 --- a/src/User/Module.php +++ b/src/User/Module.php @@ -28,6 +28,10 @@ class Module extends BaseModule * @see http://2fa-library.readthedocs.io/en/latest/ */ public $twoFactorAuthenticationCycles = 1; + /** + * @var bool whether to allow autologin or not + */ + public $enableAutologin = true; /** * @var bool whether to allow registration process or not */