From 1d8612d3f9e64cabf6697b956da98ac92eeb70a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Ba=CC=88uerle?= Date: Thu, 12 Oct 2023 12:54:23 +0200 Subject: [PATCH] feat: redirect to user home if no other direction is set --- frontend/src/routes/(user)/login/+page.server.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frontend/src/routes/(user)/login/+page.server.ts b/frontend/src/routes/(user)/login/+page.server.ts index 6b3adbf7..525a5e0a 100644 --- a/frontend/src/routes/(user)/login/+page.server.ts +++ b/frontend/src/routes/(user)/login/+page.server.ts @@ -51,6 +51,11 @@ export const actions: Actions = { showReset: err.name === 'NotAuthorizedException' }); } - throw redirect(303, data.has('redirect') ? (data.get('redirect') as string) : '/'); + throw redirect( + 303, + data.has('redirect') && data.get('redirect') !== '' + ? (data.get('redirect') as string) + : `/${username}/projects` + ); } };