TickTackk
Well-known member
- Affected version
- 2.2.1
PHP:
public function setDeviceTrusted($userId)
{
/** @var \XF\Repository\UserTfaTrusted $tfaTrustRepo */
$tfaTrustRepo = $this->repository('XF:UserTfaTrusted');
$key = $tfaTrustRepo->createTrustedKey($userId);
$this->app->response()->setCookie('tfa_trust', $key, 45 * 86400, null, true);
return $key;
}
Edit: The token can be valid from 30-34 days so saving the cookie for 45 doesn't make sense.