added missing redirects

This commit is contained in:
Alex
2025-03-01 13:30:06 +01:00
parent c6be9d2302
commit 2342ce24de
2 changed files with 4 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import { base } from '$app/paths';
import { BASE_API_URI } from '$lib/utils/constants';
import { formatError } from '$lib/utils/helpers';
import { fail, redirect } from '@sveltejs/kit';
@@ -70,7 +71,7 @@ export const actions = {
}
}
console.log('Redirecting to:', next || '/');
throw redirect(303, next || '/');
console.log('Redirecting to:', next || `${base}/`);
throw redirect(303, next || `${base}/`);
}
};

View File

@@ -6,7 +6,7 @@ import { fail, redirect } from '@sveltejs/kit';
export async function load({ locals }) {
// redirect user if not logged in
if (!locals.user) {
throw redirect(302, `${base}/auth/login?next=/`);
throw redirect(302, `${base}/auth/login?next=${base}/`);
}
}