fix: enforce login for now
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 34s
All checks were successful
deploy to cloudflare pages / deploy (push) Successful in 34s
This commit is contained in:
parent
7a25132d0b
commit
98967bc491
1 changed files with 6 additions and 1 deletions
|
@ -1,5 +1,10 @@
|
|||
import { redirect } from "@sveltejs/kit";
|
||||
import type { PageServerLoad } from "./$types";
|
||||
|
||||
export const load: PageServerLoad = async ({ locals }) => {
|
||||
return { user: locals.user };
|
||||
if (locals.user === null) {
|
||||
redirect(302, "/login");
|
||||
} else {
|
||||
return { user: locals.user };
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue