diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-16 12:39:00 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-05-17 16:10:19 +0200 |
commit | 6b7cf4672731f299de9b7b3c7e05fbb746d7fc95 (patch) | |
tree | 938221007fb4c12db864e429a4e3e02375065ac2 /lib/private/Authentication/Token/DefaultToken.php | |
parent | 9f064b08b3df4817d3c2fdc608a708827df8b0ae (diff) | |
download | nextcloud-server-6b7cf4672731f299de9b7b3c7e05fbb746d7fc95.tar.gz nextcloud-server-6b7cf4672731f299de9b7b3c7e05fbb746d7fc95.zip |
Certain tokens can expire
However due to the nature of what we store in the token (encrypted
passwords etc). We can't just delete the tokens because that would make
the oauth refresh useless.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/Authentication/Token/DefaultToken.php')
-rw-r--r-- | lib/private/Authentication/Token/DefaultToken.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php index 993dc7580ce..67aa89ea66b 100644 --- a/lib/private/Authentication/Token/DefaultToken.php +++ b/lib/private/Authentication/Token/DefaultToken.php @@ -70,6 +70,9 @@ class DefaultToken extends Entity implements IToken { /** @var string */ protected $scope; + /** @var int */ + protected $expires; + public function __construct() { $this->addType('uid', 'string'); $this->addType('loginName', 'string'); @@ -81,6 +84,7 @@ class DefaultToken extends Entity implements IToken { $this->addType('lastActivity', 'int'); $this->addType('lastCheck', 'int'); $this->addType('scope', 'string'); + $this->addType('expires', 'int'); } public function getId(): int { @@ -179,4 +183,15 @@ class DefaultToken extends Entity implements IToken { public function setPassword(string $password = null) { parent::setPassword($password); } + + public function setExpires($expires) { + parent::setExpires($expires); + } + + /** + * @return int|null + */ + public function getExpires() { + return parent::getExpires(); + } } |