Skip to content

Commit

Permalink
Fix remember browser
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Mar 1, 2022
1 parent 76c72a1 commit 2dbf783
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion helpers/TwofaHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"resources/screen2.png",
"resources/screen3.png"
],
"version": "1.0.6",
"version": "1.0.7",
"humhub": {
"minVersion": "1.8"
}
Expand Down

0 comments on commit 2dbf783

Please sign in to comment.