fixed login on legacy link user/openid_login
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -37,8 +37,9 @@
|
|||||||
|
|
||||||
|
|
||||||
async function redirectTo(e,service){
|
async function redirectTo(e,service){
|
||||||
const btn = e.target;
|
console.log(redirectTo,{e:e,service:service})
|
||||||
btn.disabled = true;
|
const btn = e?.target;
|
||||||
|
if (btn) btn.disabled = true;
|
||||||
const url = api(`user/oidc/redirect/${service}?returnTo=${window.location.pathname}`);
|
const url = api(`user/oidc/redirect/${service}?returnTo=${window.location.pathname}`);
|
||||||
const resp = await fetch(url,{credentials:'include'});
|
const resp = await fetch(url,{credentials:'include'});
|
||||||
if (resp.ok){
|
if (resp.ok){
|
||||||
@@ -50,7 +51,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
error = resp.text();
|
error = resp.text();
|
||||||
btn.disabled = false;
|
if (btn) btn.disabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (router.fullPath.endsWith('/openid_login') && router.query.service) {
|
if (router.fullPath.endsWith('/openid_login') && router.query.service) {
|
||||||
redirectTo(router.query.service);
|
redirectTo(null,router.query.service);
|
||||||
} else {
|
} else {
|
||||||
onMount(load);
|
onMount(load);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user