Merge pull request #7568 from nextcloud/stable12-fix-duplicate-session-token

[stable12] Fix duplicate session token after remembered login
This commit is contained in:
Roeland Jago Douma 2017-12-19 13:33:35 +01:00 committed by GitHub
commit fe9f100a1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -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);
}
/**

View File

@ -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');
}