summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2016-08-03 16:24:12 +0200
committerRobin Appelman <robin@icewind.nl>2016-11-16 15:24:28 +0100
commitda63af8b021afb209308f16611508ea65399f738 (patch)
tree99e43932879ca86f66068ffda947d20d8dc16ac4 /settings
parent1afccde16a04f9a91f9c5c46090517a54670f34d (diff)
downloadnextcloud-server-da63af8b021afb209308f16611508ea65399f738.tar.gz
nextcloud-server-da63af8b021afb209308f16611508ea65399f738.zip
enable deleting/configuring new tokens
Signed-off-by: Robin Appelman <icewind@owncloud.com>
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/AuthSettingsController.php4
-rw-r--r--settings/css/settings.css8
-rw-r--r--settings/js/authtoken_view.js4
3 files changed, 12 insertions, 4 deletions
diff --git a/settings/Controller/AuthSettingsController.php b/settings/Controller/AuthSettingsController.php
index f097abf910b..4e3d05a14e8 100644
--- a/settings/Controller/AuthSettingsController.php
+++ b/settings/Controller/AuthSettingsController.php
@@ -135,11 +135,13 @@ class AuthSettingsController extends Controller {
$token = $this->generateRandomDeviceToken();
$deviceToken = $this->tokenProvider->generateToken($token, $this->uid, $loginName, $password, $name, IToken::PERMANENT_TOKEN);
+ $tokenData = $deviceToken->jsonSerialize();
+ $tokenData['canDelete'] = true;
return [
'token' => $token,
'loginName' => $loginName,
- 'deviceToken' => $deviceToken
+ 'deviceToken' => $tokenData
];
}
diff --git a/settings/css/settings.css b/settings/css/settings.css
index 7eff9df1d97..4ef1f876a63 100644
--- a/settings/css/settings.css
+++ b/settings/css/settings.css
@@ -172,14 +172,20 @@ table.nostyle td { padding: 0.2em 0; }
}
#sessions .token-list a.icon,
#apppasswords .token-list a.icon {
- display: block;
opacity: 0.6;
margin-top: 4px;
+ display: none;
+}
+
+#sessions .token-list tr:hover a.icon,
+#apppasswords .token-list tr:hover a.icon {
+ display: block;
}
#sessions .token-list td div.configure,
#apppasswords .token-list td div.configure {
display: none;
+ height: 18px;
}
#sessions .token-list tr.active div.configure,
diff --git a/settings/js/authtoken_view.js b/settings/js/authtoken_view.js
index 54561ffd1e3..7ba3ce0b924 100644
--- a/settings/js/authtoken_view.js
+++ b/settings/js/authtoken_view.js
@@ -81,7 +81,7 @@
var list = this.$('.token-list');
var tokens = this.collection.filter(function (token) {
- return parseInt(token.get('type'), 10) === _this.type;
+ return token.get('type') === _this.type;
});
list.html('');
@@ -110,7 +110,7 @@
var ts = viewData.lastActivity * 1000;
viewData.lastActivity = OC.Util.relativeModifiedDate(ts);
viewData.lastActivityTime = OC.Util.formatDate(ts, 'LLL');
- viewData.canScope = token.get('type') === '1';
+ viewData.canScope = token.get('type') === 1;
// preserve title for cases where we format it further
viewData.title = viewData.name;