frontend redirects

This commit is contained in:
Alex
2025-03-02 23:12:29 +01:00
parent 1f61c9ad71
commit 6937ab333c
2 changed files with 4 additions and 4 deletions

View File

@@ -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/`);
}
}

View File

@@ -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}`);
}
};