added missing redirects
This commit is contained in:
@@ -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}/`);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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}/`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user