mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
feat: ✨ When signing in, use clientside navigation when redirecting to OAuth if on same origin
This commit is contained in:
parent
3c8093a3d2
commit
4ae54b3af9
|
|
@ -92,7 +92,13 @@ const signIn = async () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.location.href = url;
|
// Check if URL is on the same origin
|
||||||
|
if (new URL(url).hostname === useRequestURL().hostname) {
|
||||||
|
await navigateTo(new URL(url).pathname);
|
||||||
|
} else {
|
||||||
|
window.location.href = url;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const signOut = async () => {
|
const signOut = async () => {
|
||||||
|
|
@ -110,7 +116,7 @@ const signOut = async () => {
|
||||||
tokenData.value.access_token,
|
tokenData.value.access_token,
|
||||||
tokenData.value.access_token,
|
tokenData.value.access_token,
|
||||||
)
|
)
|
||||||
.catch(() => {});
|
.catch(() => { });
|
||||||
|
|
||||||
tokenData.value = null;
|
tokenData.value = null;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue