From 6937ab333ca0181d7d18e7b226a106f34c96efe7 Mon Sep 17 00:00:00 2001 From: Alex <$(pass /github/email)> Date: Sun, 2 Mar 2025 23:12:29 +0100 Subject: [PATCH] frontend redirects --- frontend/src/routes/auth/admin/users/+layout.server.js | 4 ++-- frontend/src/routes/auth/login/+page.server.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/src/routes/auth/admin/users/+layout.server.js b/frontend/src/routes/auth/admin/users/+layout.server.js index b16803f..e8244ba 100644 --- a/frontend/src/routes/auth/admin/users/+layout.server.js +++ b/frontend/src/routes/auth/admin/users/+layout.server.js @@ -16,7 +16,7 @@ export async function load({ cookies, fetch, locals }) { if (!response.ok) { // Clear the invalid JWT cookie cookies.delete('jwt', { path: '/' }); - throw redirect(302, `${base}/auth/login?next=${base}admin/users/`); + throw redirect(302, `${base}/auth/login?next=${base}/auth/admin/users/`); } const data = await response.json(); @@ -44,6 +44,6 @@ export async function load({ cookies, fetch, locals }) { // In case of any error, clear the JWT cookie cookies.delete('jwt', { path: '/' }); - throw redirect(302, `${base}/auth/login?next=${base}/admin/users/`); + throw redirect(302, `${base}/auth/login?next=${base}/auth/admin/users/`); } } diff --git a/frontend/src/routes/auth/login/+page.server.js b/frontend/src/routes/auth/login/+page.server.js index 07db817..bded82a 100644 --- a/frontend/src/routes/auth/login/+page.server.js +++ b/frontend/src/routes/auth/login/+page.server.js @@ -71,7 +71,7 @@ export const actions = { } } - console.log('Redirecting to:', next || `${base}/`); - throw redirect(303, next || `${base}/`); + console.log('Redirecting to:', next || `${base}/auth/about/${responseBody.user.id}`); + throw redirect(303, next || `${base}/auth/about/${responseBody.user.id}`); } };