Skip to content

Commit

Permalink
fix: fix login redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Sep 2, 2024
1 parent e5d2a73 commit e38a10b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/frontend/src/routes/(auth)/login/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
<div class="mt-4 text-center text-sm">
Don&apos;t have an account?
{#if redirect}
<a href="/signup?redirect={redirect}" class="underline"> Sign up </a>
<a href="/signup?redirect={encodeURIComponent(redirect)}" class="underline"> Sign up </a>
{:else}
<a href="/signup" class="underline"> Sign up </a>
{/if}
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/routes/(auth)/signup/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
async onSuccess(data, variables, context) {
if (redirect) {
await goto(redirect)
window.location.href = redirect
} else {
await goto("/")
}
Expand Down Expand Up @@ -245,7 +245,7 @@
{#if invitationId}
<a href={`/login?invitationId=${invitationId}`} class="underline"> Sign in </a>
{:else if redirect}
<a href={`/login?redirect=${redirect}`} class="underline"> Sign in </a>
<a href={`/login?redirect=${encodeURIComponent(redirect)}`} class="underline"> Sign in </a>
{:else}
<a href="/login" class="underline"> Sign in </a>
{/if}
Expand Down

0 comments on commit e38a10b

Please sign in to comment.