Skip to content

Commit

Permalink
Merge pull request #7982 from Oldiesmann/fix_tfa_cookie
Browse files Browse the repository at this point in the history
Ensure the member is always an int when setting TFA cookies
  • Loading branch information
Sesquipedalian authored Dec 30, 2023
2 parents 260536f + 7e67daa commit af6df6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function __construct(

// Special case for the login and TFA cookies.
if (in_array($this->name, [Config::$cookiename, Config::$cookiename . '_tfa'])) {
$this->member = $this->custom_data[0] ?? User::$me->id;
$this->member = (int) ($this->custom_data[0] ?? User::$me->id);
$this->hash = $this->custom_data[1] ?? self::encrypt(User::$me->passwd, User::$me->password_salt);

$expires = $expires ?? $this->custom_data[2] ?? null;
Expand Down

0 comments on commit af6df6b

Please sign in to comment.