From d7d278037e7b21cfee8d0033cda1b3e3be8691af Mon Sep 17 00:00:00 2001 From: Lou Knauer Date: Fri, 8 Jul 2022 10:51:33 +0200 Subject: [PATCH] Fixes #15: Copy JWT to clipboard automatically --- web/templates/config.tmpl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web/templates/config.tmpl b/web/templates/config.tmpl index 2ef9258..deccf92 100644 --- a/web/templates/config.tmpl +++ b/web/templates/config.tmpl @@ -49,6 +49,7 @@
Special Users

Not created by an LDAP sync and/or having a role other than user

+
@@ -91,7 +92,13 @@ let username = row.children[0].innerText fetch(`/api/jwt/?username=${username}`) .then(res => res.text()) - .then(text => alert(text)) + .then(text => { + // let elm = document.querySelector('#generated-jwt') + // elm.innerText = `JWT: ${text}` + // elm.scrollIntoView() + event.target.parentElement.innerHTML = `` + navigator.clipboard.writeText(text).catch(reason => console.error(reason)) + }) })) listElement.querySelectorAll('button.del-user').forEach(e => e.addEventListener('click', event => {