aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2024-01-08 17:47:22 +0100
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>2024-01-11 18:01:00 +0000
commit63fbf90570e7ed905fc323e4e212c28dc100994c (patch)
tree1f47d34f791aefd94f0ba5cd708b77fd43ef4b7f /lib/private/Authentication
parent360e7ffcca0940400317d238cfce751b6b10d058 (diff)
downloadnextcloud-server-63fbf90570e7ed905fc323e4e212c28dc100994c.tar.gz
nextcloud-server-63fbf90570e7ed905fc323e4e212c28dc100994c.zip
Suppress or fix psalm errors related to InvalidTokenException
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r--lib/private/Authentication/Token/IProvider.php6
-rw-r--r--lib/private/Authentication/Token/Manager.php4
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/Authentication/Token/IProvider.php b/lib/private/Authentication/Token/IProvider.php
index 4af5e2b25c3..b852f4e7e86 100644
--- a/lib/private/Authentication/Token/IProvider.php
+++ b/lib/private/Authentication/Token/IProvider.php
@@ -29,10 +29,10 @@ declare(strict_types=1);
*/
namespace OC\Authentication\Token;
-use OC\Authentication\Exceptions\ExpiredTokenException;
-use OC\Authentication\Exceptions\InvalidTokenException;
use OC\Authentication\Exceptions\PasswordlessTokenException;
-use OC\Authentication\Exceptions\WipeTokenException;
+use OCP\Authentication\Exceptions\ExpiredTokenException;
+use OCP\Authentication\Exceptions\InvalidTokenException;
+use OCP\Authentication\Exceptions\WipeTokenException;
interface IProvider {
/**
diff --git a/lib/private/Authentication/Token/Manager.php b/lib/private/Authentication/Token/Manager.php
index 9154092f25a..d84a81705ff 100644
--- a/lib/private/Authentication/Token/Manager.php
+++ b/lib/private/Authentication/Token/Manager.php
@@ -29,9 +29,9 @@ namespace OC\Authentication\Token;
use Doctrine\DBAL\Exception\UniqueConstraintViolationException;
use OC\Authentication\Exceptions\InvalidTokenException as OcInvalidTokenException;
+use OC\Authentication\Exceptions\PasswordlessTokenException;
use OCP\Authentication\Exceptions\ExpiredTokenException;
use OCP\Authentication\Exceptions\InvalidTokenException;
-use OCP\Authentication\Exceptions\PasswordlessTokenException;
use OCP\Authentication\Exceptions\WipeTokenException;
use OCP\Authentication\Token\IProvider as OCPIProvider;
@@ -222,6 +222,7 @@ class Manager implements IProvider, OCPIProvider {
return $this->publicKeyTokenProvider->rotate($token, $oldTokenId, $newTokenId);
}
+ /** @psalm-suppress DeprecatedClass We have to throw the OC version so both OC and OCP catches catch it */
throw new OcInvalidTokenException();
}
@@ -234,6 +235,7 @@ class Manager implements IProvider, OCPIProvider {
if ($token instanceof PublicKeyToken) {
return $this->publicKeyTokenProvider;
}
+ /** @psalm-suppress DeprecatedClass We have to throw the OC version so both OC and OCP catches catch it */
throw new OcInvalidTokenException();
}