From 96e94e0a7569baeec7394f4353cdd630439a6529 Mon Sep 17 00:00:00 2001 From: Friedrich Weber Date: Sat, 22 Jul 2017 18:27:24 +0200 Subject: [PATCH] Initialize lastCheck when creating session token --- lib/private/Authentication/Token/DefaultTokenProvider.php | 1 + tests/lib/Authentication/Token/DefaultTokenProviderTest.php | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index c717a062e4e0..e416c11fe01f 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -85,6 +85,7 @@ public function generateToken($token, $uid, $loginName, $password, $name, $type $dbToken->setToken($this->hashToken($token)); $dbToken->setType($type); $dbToken->setLastActivity($this->time->getTime()); + $dbToken->setLastCheck($this->time->getTime()); $this->mapper->insert($dbToken); diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php index 1eca4c43bda8..bc8ca1f3a4f2 100644 --- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php +++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php @@ -77,6 +77,7 @@ public function testGenerateToken() { $toInsert->setToken(hash('sha512', $token . '1f4h9s')); $toInsert->setType($type); $toInsert->setLastActivity($this->time); + $toInsert->setLastCheck($this->time); $this->config->expects($this->any()) ->method('getSystemValue')