🐛 Fixed more errors coming from upgrading SvelteKit
This commit is contained in:
@@ -1,13 +1,14 @@
|
||||
import { redirect, error } from '@sveltejs/kit';
|
||||
import { signedIn } from '$lib/stores';
|
||||
|
||||
export async function load({ url, session }) {
|
||||
export async function load({ url, parent }) {
|
||||
const quiz_id = url.searchParams.get('quiz_id');
|
||||
if (!session.authenticated) {
|
||||
const { email } = await parent();
|
||||
if (!email) {
|
||||
throw redirect(302, `/account/login?returnTo=/edit?quiz_id=${quiz_id}`);
|
||||
}
|
||||
|
||||
if (session.authenticated) {
|
||||
if (email) {
|
||||
signedIn.set(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user