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

@@ -10,15 +10,16 @@ import {
processSubscriptionFormData,
processUserFormData
} from '$lib/utils/processing';
import { base } from '$app/paths';
/** @type {import('./$types').PageServerLoad} */
export async function load({ locals }) {
// redirect user if not logged in
if (!locals.user) {
throw redirect(302, `/auth/login?next=/auth/admin/users`);
throw redirect(302, `${base}/auth/login?next=${base}/auth/admin/users`);
}
if (locals.user.role_id === 0) {
throw redirect(302, `/auth/about/${locals.user.id}`);
throw redirect(302, `${base}/auth/about/${locals.user.id}`);
}
}
@@ -66,7 +67,7 @@ export const actions = {
console.log('Server success response:', response);
locals.user = response;
userDatesFromRFC3339(locals.user);
throw redirect(303, `/auth/admin/users`);
throw redirect(303, `${base}/auth/admin/users`);
},
/**
@@ -108,7 +109,7 @@ export const actions = {
const response = await res.json();
console.log('Server success response:', response);
throw redirect(303, `/auth/admin/users`);
throw redirect(303, `${base}/auth/admin/users`);
},
/**
@@ -148,7 +149,7 @@ export const actions = {
const response = await res.json();
console.log('Server success response:', response);
throw redirect(303, `/auth/admin/users`);
throw redirect(303, `${base}/auth/admin/users`);
},
/**
@@ -188,6 +189,6 @@ export const actions = {
const response = await res.json();
console.log('Server success response:', response);
throw redirect(303, `/auth/admin/users`);
throw redirect(303, `${base}/auth/admin/users`);
}
};