Skip to content

Commit e38a10b

Browse files
committed
fix: fix login redirect
1 parent e5d2a73 commit e38a10b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

apps/frontend/src/routes/(auth)/login/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
<div class="mt-4 text-center text-sm">
210210
Don&apos;t have an account?
211211
{#if redirect}
212-
<a href="/signup?redirect={redirect}" class="underline"> Sign up </a>
212+
<a href="/signup?redirect={encodeURIComponent(redirect)}" class="underline"> Sign up </a>
213213
{:else}
214214
<a href="/signup" class="underline"> Sign up </a>
215215
{/if}

apps/frontend/src/routes/(auth)/signup/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
},
6464
async onSuccess(data, variables, context) {
6565
if (redirect) {
66-
await goto(redirect)
66+
window.location.href = redirect
6767
} else {
6868
await goto("/")
6969
}
@@ -245,7 +245,7 @@
245245
{#if invitationId}
246246
<a href={`/login?invitationId=${invitationId}`} class="underline"> Sign in </a>
247247
{:else if redirect}
248-
<a href={`/login?redirect=${redirect}`} class="underline"> Sign in </a>
248+
<a href={`/login?redirect=${encodeURIComponent(redirect)}`} class="underline"> Sign in </a>
249249
{:else}
250250
<a href="/login" class="underline"> Sign in </a>
251251
{/if}

0 commit comments

Comments
 (0)