changed dev and production base url

This commit is contained in:
Alex
2025-03-01 12:12:40 +01:00
parent 7216a48f4e
commit 1d57b8e8e8
14 changed files with 55 additions and 48 deletions

View File

@@ -1,6 +1,7 @@
import { BASE_API_URI } from '$lib/utils/constants';
import { redirect } from '@sveltejs/kit';
import { userDatesFromRFC3339, refreshCookie } from '$lib/utils/helpers';
import { base } from '$app/paths';
/** @type {import('./$types').LayoutServerLoad} */
export async function load({ cookies, fetch, locals }) {
@@ -15,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, '/auth/login?next=admin/users/');
throw redirect(302, `${base}/auth/login?next=${base}admin/users/`);
}
const data = await response.json();
@@ -42,6 +43,6 @@ export async function load({ cookies, fetch, locals }) {
// In case of any error, clear the JWT cookie
cookies.delete('jwt', { path: '/' });
throw redirect(302, '/auth/login?next=admin/users/');
throw redirect(302, `${base}/auth/login?next=${base}/admin/users/`);
}
}