diff options
Diffstat (limited to 'lib/private/Authentication/Token/Manager.php')
-rw-r--r-- | lib/private/Authentication/Token/Manager.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/private/Authentication/Token/Manager.php b/lib/private/Authentication/Token/Manager.php index 8dd41ce1096..254a1598943 100644 --- a/lib/private/Authentication/Token/Manager.php +++ b/lib/private/Authentication/Token/Manager.php @@ -25,7 +25,6 @@ namespace OC\Authentication\Token; use OC\Authentication\Exceptions\InvalidTokenException; use OC\Authentication\Exceptions\PasswordlessTokenException; -use OCP\IUser; class Manager implements IProvider { @@ -92,6 +91,10 @@ class Manager implements IProvider { $provider->updateTokenActivity($token); } + /** + * @param string $uid + * @return IToken[] + */ public function getTokenByUser(string $uid): array { $old = $this->defaultTokenProvider->getTokenByUser($uid); $new = $this->publicKeyTokenProvider->getTokenByUser($uid); @@ -185,6 +188,13 @@ class Manager implements IProvider { $this->publicKeyTokenProvider->invalidateOldTokens(); } + /** + * @param IToken $token + * @param string $oldTokenId + * @param string $newTokenId + * @return IToken + * @throws InvalidTokenException + */ public function rotate(IToken $token, string $oldTokenId, string $newTokenId): IToken { if ($token instanceof DefaultToken) { try { @@ -203,6 +213,11 @@ class Manager implements IProvider { throw new InvalidTokenException(); } + /** + * @param IToken $token + * @return IProvider + * @throws InvalidTokenException + */ private function getProvider(IToken $token): IProvider { if ($token instanceof DefaultToken) { return $this->defaultTokenProvider; |