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