🐛 Fixed more errors coming from upgrading SvelteKit
This commit is contained in:
+6
-4
@@ -1,10 +1,12 @@
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export async function load({ session }) {
|
||||
if (!session.authenticated) {
|
||||
export const load = async ({ parent }) => {
|
||||
const { email } = await parent();
|
||||
|
||||
if (!email) {
|
||||
throw redirect(302, '/account/login?returnTo=/dashboard');
|
||||
}
|
||||
return {
|
||||
email: session.email
|
||||
email
|
||||
};
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user