mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Make sure that OC interfaces returns OC interfaces for backward compatibility
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
b82e25ea7a
commit
1bdf952fde
6 changed files with 48 additions and 2 deletions
|
|
@ -53,14 +53,13 @@ use OCP\Session\Exceptions\SessionNotAvailableException;
|
|||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class AuthSettingsController extends Controller {
|
||||
|
||||
/** @var IProvider */
|
||||
private $tokenProvider;
|
||||
|
||||
/** @var ISession */
|
||||
private $session;
|
||||
|
||||
/** IUserSession */
|
||||
/** @var IUserSession */
|
||||
private $userSession;
|
||||
|
||||
/** @var string */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,22 @@ namespace OCP\Authentication\Exceptions;
|
|||
|
||||
use OCP\Authentication\Token\IToken;
|
||||
|
||||
/**
|
||||
* @since 28.0
|
||||
*/
|
||||
class ExpiredTokenException extends InvalidTokenException {
|
||||
/**
|
||||
* @since 28.0
|
||||
*/
|
||||
public function __construct(
|
||||
private IToken $token,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 28.0
|
||||
*/
|
||||
public function getToken(): IToken {
|
||||
return $this->token;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,5 +26,8 @@ namespace OCP\Authentication\Exceptions;
|
|||
|
||||
use Exception;
|
||||
|
||||
/**
|
||||
* @since 28.0
|
||||
*/
|
||||
class InvalidTokenException extends Exception {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,13 +27,22 @@ namespace OCP\Authentication\Exceptions;
|
|||
|
||||
use OCP\Authentication\Token\IToken;
|
||||
|
||||
/**
|
||||
* @since 28.0
|
||||
*/
|
||||
class WipeTokenException extends InvalidTokenException {
|
||||
/**
|
||||
* @since 28.0
|
||||
*/
|
||||
public function __construct(
|
||||
private IToken $token,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 28.0
|
||||
*/
|
||||
public function getToken(): IToken {
|
||||
return $this->token;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue