summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorSergej Nikolaev <kinolaev@gmail.com>2019-10-04 03:28:48 +0300
committerBackportbot <backportbot-noreply@rullzer.com>2019-10-05 10:35:46 +0000
commit5c5d658b0eb3719ae6b2ea375ff3eac27411262a (patch)
treeb6ac14e1a93fb03d3db3c128594c7c004359fc7c /settings
parentb5ad2f9cb5863aad6749593fe8532ebd0c5558f6 (diff)
downloadnextcloud-server-5c5d658b0eb3719ae6b2ea375ff3eac27411262a.tar.gz
nextcloud-server-5c5d658b0eb3719ae6b2ea375ff3eac27411262a.zip
fix updating and deleting authtokens
Signed-off-by: Sergej Nikolaev <kinolaev@gmail.com>
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/AuthSettingsController.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php
index da9414dcb10..1d6e26d0f73 100644
--- a/settings/Controller/AuthSettingsController.php
+++ b/settings/Controller/AuthSettingsController.php
@@ -29,6 +29,7 @@ namespace OC\Settings\Controller;
use BadMethodCallException;
use OC\Authentication\Exceptions\InvalidTokenException;
+use OC\Authentication\Exceptions\ExpiredTokenException;
use OC\Authentication\Exceptions\PasswordlessTokenException;
use OC\Authentication\Exceptions\WipeTokenException;
use OC\Authentication\Token\INamedToken;
@@ -248,10 +249,13 @@ class AuthSettingsController extends Controller {
* @param int $id
* @return IToken
* @throws InvalidTokenException
- * @throws \OC\Authentication\Exceptions\ExpiredTokenException
*/
private function findTokenByIdAndUser(int $id): IToken {
- $token = $this->tokenProvider->getTokenById($id);
+ try {
+ $token = $this->tokenProvider->getTokenById($id);
+ } catch (ExpiredTokenException $e) {
+ $token = $e->getToken();
+ }
if ($token->getUID() !== $this->uid) {
throw new InvalidTokenException('This token does not belong to you!');
}