changed dev and production base url
This commit is contained in:
@@ -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/`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user