Variable ADMIN_ACCESS_JSConst
ADMIN_ACCESS_JS: "(function () {\n\tconst out = document.getElementById('oidc-out');\n\tconst shown = document.getElementById('oidc-discovery');\n\tfunction esc(s) {\n\t\tconst e = document.createElement('span');\n\t\te.textContent = String(s == null ? '' : s);\n\t\treturn e.innerHTML;\n\t}\n\tasync function send(url, init) {\n\t\tconst res = await fetch(url, Object.assign({ credentials: 'same-origin' }, init || {}));\n\t\tif (res.status === 401) {\n\t\t\twindow.location.href =\n\t\t\t\t'__CFW_LOGIN_PATH__?next=' + encodeURIComponent(location.pathname);\n\t\t\treturn null;\n\t\t}\n\t\tconst body = await res.json().catch(() => ({}));\n\t\tif (!res.ok || body.ok === false) throw new Error(body.error || 'HTTP ' + res.status);\n\t\treturn body;\n\t}\n\tdocument.getElementById('oidc-form').addEventListener('submit', async (e) => {\n\t\te.preventDefault();\n\t\tout.textContent = 'Saving...';\n\t\ttry {\n\t\t\tconst body = await send('/setup/oidc?action=save', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: { 'content-type': 'application/x-www-form-urlencoded' },\n\t\t\t\tbody: new URLSearchParams(new FormData(e.target)).toString()\n\t\t\t});\n\t\t\tif (!body) return;\n\t\t\tout.textContent = 'Saved.';\n\t\t\tconst dd = body.discovery;\n\t\t\tshown.innerHTML = !dd\n\t\t\t\t? ''\n\t\t\t\t: dd.ok\n\t\t\t\t\t? '<div class=\"card\"><strong>Discovery</strong><p class=\"sub\" style=\"margin:.3rem 0 0\">authorization <code>' +\n\t\t\t\t\t\tesc(dd.authorization) +\n\t\t\t\t\t\t'</code><br>token <code>' +\n\t\t\t\t\t\tesc(dd.token) +\n\t\t\t\t\t\t'</code><br>jwks <code>' +\n\t\t\t\t\t\tesc(dd.jwks) +\n\t\t\t\t\t\t'</code></p></div>'\n\t\t\t\t\t: '<div class=\"card bad\"><strong>Discovery</strong><p class=\"sub\" style=\"margin:.3rem 0 0\"><span class=\"over\">' +\n\t\t\t\t\t\tesc(dd.error) +\n\t\t\t\t\t\t'</span></p></div>';\n\t\t\tdocument.getElementById('oidc-clear').disabled = false;\n\t\t} catch (err) {\n\t\t\tout.textContent = 'Refused: ' + err.message;\n\t\t}\n\t});\n\tdocument.getElementById('oidc-clear').addEventListener('click', async () => {\n\t\tif (!window.confirm('Clear the issuer and client id? Single sign-on stops working.'))\n\t\t\treturn;\n\t\tout.textContent = 'Clearing...';\n\t\ttry {\n\t\t\tif (await send('/setup/oidc?action=clear')) window.location.reload();\n\t\t} catch (err) {\n\t\t\tout.textContent = 'Refused: ' + err.message;\n\t\t}\n\t});\n})();\n"