From bb19b3709706b49cdae65c77d28ab89ad3679951 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 12 May 2017 14:55:30 +0200 Subject: [PATCH] hide client secret by default Signed-off-by: Bjoern Schiessle --- apps/oauth2/css/setting-admin.css | 5 +++++ apps/oauth2/js/setting-admin.js | 16 ++++++++++++++++ apps/oauth2/templates/admin.php | 7 +++++-- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 apps/oauth2/css/setting-admin.css create mode 100644 apps/oauth2/js/setting-admin.js diff --git a/apps/oauth2/css/setting-admin.css b/apps/oauth2/css/setting-admin.css new file mode 100644 index 0000000000..a57a56bb97 --- /dev/null +++ b/apps/oauth2/css/setting-admin.css @@ -0,0 +1,5 @@ +.show-oauth-credentials { + padding-left: 10px; + opacity: 0.3; + cursor: pointer; +} diff --git a/apps/oauth2/js/setting-admin.js b/apps/oauth2/js/setting-admin.js new file mode 100644 index 0000000000..be774fd720 --- /dev/null +++ b/apps/oauth2/js/setting-admin.js @@ -0,0 +1,16 @@ + +$(document).ready(function () { + + $('.show-oauth-credentials').click(function() { + var row = $(this).parent(); + var code = $(row).find('code'); + if(code.text() === '****') { + code.text(row.data('value')); + $(this).css('opacity', 0.9); + } else { + code.text('****'); + $(this).css('opacity', 0.3); + } + }) + +}); diff --git a/apps/oauth2/templates/admin.php b/apps/oauth2/templates/admin.php index f5b8532e6b..9c09499add 100644 --- a/apps/oauth2/templates/admin.php +++ b/apps/oauth2/templates/admin.php @@ -22,6 +22,9 @@ $urlGenerator = \OC::$server->getURLGenerator(); $themingDefaults = \OC::$server->getThemingDefaults(); +script('oauth2', 'setting-admin'); +style('oauth2', 'setting-admin'); + /** @var array $_ */ /** @var \OCA\OAuth2\Db\Client[] $clients */ $clients = $_['clients']; @@ -47,7 +50,7 @@ $clients = $_['clients']; getName()); ?> getRedirectUri()); ?> getClientIdentifier()); ?> - getSecret()); ?> + ****
@@ -67,4 +70,4 @@ $clients = $_['clients'];
- \ No newline at end of file +