Skip to content

Commit

Permalink
feat: ✨ When signing in, use clientside navigation when redirecting t…
Browse files Browse the repository at this point in the history
…o OAuth if on same origin
  • Loading branch information
CPlusPatch committed Apr 27, 2024
1 parent 3c8093a commit 4ae54b3
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/sidebars/navigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,13 @@ const signIn = async () => {
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 () => {
Expand All @@ -110,7 +116,7 @@ const signOut = async () => {
tokenData.value.access_token,
tokenData.value.access_token,
)
.catch(() => {});
.catch(() => { });
tokenData.value = null;
};
Expand Down

0 comments on commit 4ae54b3

Please sign in to comment.