diff options
| author | martin f. krafft <madduck@madduck.net> | 2025-09-16 16:36:52 +0200 |
|---|---|---|
| committer | martin f. krafft <madduck@madduck.net> | 2025-09-16 16:36:52 +0200 |
| commit | d49f86c2bb7b5bda12bde570e70ce18e5e6e80e4 (patch) | |
| tree | 0778fcc9ab06d3b33bf32bd1ae8976f2ef7dbb7e | |
| parent | f856889fde61a6127b1229a9addb6462c128fff1 (diff) | |
| parent | 416c45f6fc4905cd96bf87879f7d0a427f87bfe3 (diff) | |
Merge branch 'staging' into production
| -rw-r--r-- | inject/disable-password-login.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/inject/disable-password-login.js b/inject/disable-password-login.js index d939e0c..fd66b74 100644 --- a/inject/disable-password-login.js +++ b/inject/disable-password-login.js @@ -1,17 +1,13 @@ export function disablePasswordLogin() { - const queryString = new URLSearchParams(); - if (queryString.get("all") == null) { + const queryString = new URLSearchParams(window.location.search); + if (queryString.get("pwauth") == null) { document.addEventListener("DOMContentLoaded", function () { const sso = document.querySelector(".o_auth_oauth_providers"); if (sso) { const link = sso.getElementsByTagName("a")[0]; - if (link.innerText.search("Authentik") > 0) { + if (link.innerText.search("Authentik") + link.innerText.search("TONI SSO") > 0) { console.info("Redirecting to SSO login:", link.href); - // Disable for now while we don't have a way to prevent redirection - // for e.g. admin login. One way would be to scan for presence of a - // query string parameter such as `pwauth`, but I could not get - // URLSearchParams to help me. - //window.location.replace(link.href); + window.location.replace(link.href); } } }); |
