Skip to content

Commit

Permalink
fix(nuxt-auth): fix redirect with protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Feb 28, 2023
1 parent c251e0d commit 609af43
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions starter/nuxt-auth/components/auth/AuthLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,15 @@ const onSubmit = handleSubmit(async (values) => {
return;
}
const callbackUrl: any = route.query?.next || route.query?.callbackUrl;
const nextUrl: any = route.query?.next || route.query?.callbackUrl;
const callbackUrl = nextUrl || appConfig.auth?.redirect?.home || '/';
router.push(callbackUrl || appConfig.auth?.redirect?.home || '/');
if (callbackUrl.startsWith('http')) {
location.href = callbackUrl;
return;
}
router.push(callbackUrl);
});
const socialProviders = computed(() => {
Expand Down

0 comments on commit 609af43

Please sign in to comment.