aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2023-10-23 10:57:26 +0200
committerCôme Chilliet <come.chilliet@nextcloud.com>2023-10-23 11:08:23 +0200
commit1bdf952fdeab6305785cae3522eb4807c0e68c99 (patch)
treeaddd703543681866bad2fcb3b89fdb24e32ebd44 /lib/private/Authentication
parentb82e25ea7a13e98212201a905718309a3d1415ae (diff)
downloadnextcloud-server-1bdf952fdeab6305785cae3522eb4807c0e68c99.tar.gz
nextcloud-server-1bdf952fdeab6305785cae3522eb4807c0e68c99.zip
Make sure that OC interfaces returns OC interfaces for backward compatibility
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r--lib/private/Authentication/Exceptions/ExpiredTokenException.php13
-rw-r--r--lib/private/Authentication/Exceptions/WipeTokenException.php13
2 files changed, 26 insertions, 0 deletions
diff --git a/lib/private/Authentication/Exceptions/ExpiredTokenException.php b/lib/private/Authentication/Exceptions/ExpiredTokenException.php
index c23a1176fae..18618a557f3 100644
--- a/lib/private/Authentication/Exceptions/ExpiredTokenException.php
+++ b/lib/private/Authentication/Exceptions/ExpiredTokenException.php
@@ -25,8 +25,21 @@ declare(strict_types=1);
*/
namespace OC\Authentication\Exceptions;
+use OC\Authentication\Token\IToken;
+
/**
* @deprecated 28.0.0 use OCP version instead
*/
class ExpiredTokenException extends \OCP\Authentication\Exceptions\ExpiredTokenException {
+ public function __construct(
+ IToken $token,
+ ) {
+ parent::__construct($token);
+ }
+
+ public function getToken(): IToken {
+ $token = parent::getToken();
+ /** @var IToken $token We know that we passed OC interface from constructor */
+ return $token;
+ }
}
diff --git a/lib/private/Authentication/Exceptions/WipeTokenException.php b/lib/private/Authentication/Exceptions/WipeTokenException.php
index 8ae4f74e4d7..9b24ca24430 100644
--- a/lib/private/Authentication/Exceptions/WipeTokenException.php
+++ b/lib/private/Authentication/Exceptions/WipeTokenException.php
@@ -25,8 +25,21 @@ declare(strict_types=1);
*/
namespace OC\Authentication\Exceptions;
+use OC\Authentication\Token\IToken;
+
/**
* @deprecated 28.0.0 use OCP version instead
*/
class WipeTokenException extends \OCP\Authentication\Exceptions\WipeTokenException {
+ public function __construct(
+ IToken $token,
+ ) {
+ parent::__construct($token);
+ }
+
+ public function getToken(): IToken {
+ $token = parent::getToken();
+ /** @var IToken $token We know that we passed OC interface from constructor */
+ return $token;
+ }
}