diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-08 11:01:53 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-10-09 10:10:37 +0200 |
commit | 5122629bb0ff59a1688029d65e919ce31db8eced (patch) | |
tree | 367a89874edd75bc63c89fc0812a49ab5a9a64bc /lib/private/Authentication/Token/DefaultTokenProvider.php | |
parent | f663154adfb81848295bbb6ddcc7ac9582c3a475 (diff) | |
download | nextcloud-server-5122629bb0ff59a1688029d65e919ce31db8eced.tar.gz nextcloud-server-5122629bb0ff59a1688029d65e919ce31db8eced.zip |
Make renewSessionToken return the new token
Avoids directly getting the token again. We just inserted it so it and
have all the info. So that query is just a waste.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Authentication/Token/DefaultTokenProvider.php')
-rw-r--r-- | lib/private/Authentication/Token/DefaultTokenProvider.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Authentication/Token/DefaultTokenProvider.php b/lib/private/Authentication/Token/DefaultTokenProvider.php index 98609a3f14b..6bd7c2c6dc8 100644 --- a/lib/private/Authentication/Token/DefaultTokenProvider.php +++ b/lib/private/Authentication/Token/DefaultTokenProvider.php @@ -196,8 +196,9 @@ class DefaultTokenProvider implements IProvider { * @param string $oldSessionId * @param string $sessionId * @throws InvalidTokenException + * @return IToken */ - public function renewSessionToken(string $oldSessionId, string $sessionId) { + public function renewSessionToken(string $oldSessionId, string $sessionId): IToken { $token = $this->getToken($oldSessionId); $newToken = new DefaultToken(); @@ -214,6 +215,8 @@ class DefaultTokenProvider implements IProvider { $newToken->setLastActivity($this->time->getTime()); $this->mapper->insert($newToken); $this->mapper->delete($token); + + return $newToken; } /** |