summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/Authentication/Token/DefaultTokenProvider.php1
-rw-r--r--tests/lib/Authentication/Token/DefaultTokenProviderTest.php8
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php
index a1a7e83ea21..80bcc4aeac8 100644
--- a/lib/private/Authentication/Token/DefaultTokenProvider.php
+++ b/lib/private/Authentication/Token/DefaultTokenProvider.php
@@ -195,6 +195,7 @@ class DefaultTokenProvider implements IProvider {
$newToken->setRemember($token->getRemember());
$newToken->setLastActivity($this->time->getTime());
$this->mapper->insert($newToken);
+ $this->mapper->delete($token);
}
/**
diff --git a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
index 2c8c2d7e196..96fdbaa176f 100644
--- a/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
+++ b/tests/lib/Authentication/Token/DefaultTokenProviderTest.php
@@ -318,6 +318,10 @@ class DefaultTokenProviderTest extends TestCase {
->expects($this->at(1))
->method('insert')
->with($newToken);
+ $this->mapper
+ ->expects($this->at(2))
+ ->method('delete')
+ ->with($token);
$this->tokenProvider->renewSessionToken('oldId', 'newId');
}
@@ -384,6 +388,10 @@ class DefaultTokenProviderTest extends TestCase {
->expects($this->at(1))
->method('insert')
->with($this->equalTo($newToken));
+ $this->mapper
+ ->expects($this->at(2))
+ ->method('delete')
+ ->with($token);
$this->tokenProvider->renewSessionToken('oldId', 'newId');
}