summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@owncloud.com>2016-05-18 12:03:22 +0200
committerChristoph Wurst <christoph@owncloud.com>2016-05-23 09:11:12 +0200
commit12431aa3997154aaea4eec11c2dd65f9e5dbe179 (patch)
tree8395c270b144401f53e5ed048f94a28002410e3d /lib/private/Authentication
parent357d342467b9200f190376a2bd224fa7b803b45a (diff)
downloadnextcloud-server-12431aa3997154aaea4eec11c2dd65f9e5dbe179.tar.gz
nextcloud-server-12431aa3997154aaea4eec11c2dd65f9e5dbe179.zip
list user's auth tokens on the personal settings page
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r--lib/private/Authentication/Token/DefaultToken.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/Authentication/Token/DefaultToken.php b/lib/private/Authentication/Token/DefaultToken.php
index 08451a46151..ca4c723fba3 100644
--- a/lib/private/Authentication/Token/DefaultToken.php
+++ b/lib/private/Authentication/Token/DefaultToken.php
@@ -22,6 +22,7 @@
namespace OC\Authentication\Token;
+use JsonSerializable;
use OCP\AppFramework\Db\Entity;
/**
@@ -38,7 +39,7 @@ use OCP\AppFramework\Db\Entity;
* @method void setLastActivity(int $lastActivity)
* @method int getLastActivity()
*/
-class DefaultToken extends Entity implements IToken {
+class DefaultToken extends Entity implements IToken, JsonSerializable {
/**
* @var string user UID
@@ -87,4 +88,13 @@ class DefaultToken extends Entity implements IToken {
return parent::getPassword();
}
+ public function jsonSerialize() {
+ return [
+ 'id' => $this->id,
+ 'name' => $this->name,
+ 'lastActivity' => $this->lastActivity,
+ 'type' => $this->type,
+ ];
+ }
+
}