diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index e41054f..c2fa0ce 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,10 @@ Changelog ========= +1.0.7 (Unreleased) +------------------------- +- Fix #45: Fix remember browser + 1.0.6 (Februrary 2, 2022) ------------------------- - Enh #36: Update logout url to POST method diff --git a/helpers/TwofaHelper.php b/helpers/TwofaHelper.php index 99b41c5..d9363a7 100644 --- a/helpers/TwofaHelper.php +++ b/helpers/TwofaHelper.php @@ -341,7 +341,8 @@ public static function rememberBrowser($days = null) $expire = (new DateTime())->modify("+$days DAYS")->getTimestamp(); // calculate array of remembered user's - $value = Yii::$app->request->cookies->get('twofa_remember') ?? []; + $twofaRememberCookie = Yii::$app->request->cookies->get('twofa_remember'); + $value = $twofaRememberCookie instanceof Cookie ? $twofaRememberCookie->value : []; $value[] = Yii::$app->user->id; // remember browser diff --git a/module.json b/module.json index d09810d..116407b 100644 --- a/module.json +++ b/module.json @@ -12,7 +12,7 @@ "resources/screen2.png", "resources/screen3.png" ], - "version": "1.0.6", + "version": "1.0.7", "humhub": { "minVersion": "1.8" }