fixed login on legacy link user/openid_login

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-09-02 08:31:13 +02:00
parent eaa95b3b72
commit 9887f78949

View File

@@ -37,8 +37,9 @@
async function redirectTo(e,service){
const btn = e.target;
btn.disabled = true;
console.log(redirectTo,{e:e,service:service})
const btn = e?.target;
if (btn) btn.disabled = true;
const url = api(`user/oidc/redirect/${service}?returnTo=${window.location.pathname}`);
const resp = await fetch(url,{credentials:'include'});
if (resp.ok){
@@ -50,7 +51,7 @@
}
} else {
error = resp.text();
btn.disabled = false;
if (btn) btn.disabled = false;
}
}
@@ -60,7 +61,7 @@
}
if (router.fullPath.endsWith('/openid_login') && router.query.service) {
redirectTo(router.query.service);
redirectTo(null,router.query.service);
} else {
onMount(load);
}