Create the account setup page

This page is not behind (protected) because it must not use the (protected)/layout.
This means that this page also needs to handle it's own authentication, because it should not be open to the public either.
This commit is contained in:
NeilClack
2026-02-02 22:40:11 -06:00
parent 9d75cb07e4
commit 2df81d20e3
4 changed files with 49 additions and 10 deletions
+8 -10
View File
@@ -1,12 +1,10 @@
import type { LayoutServerLoad } from "./$types";
import { error } from "@sveltejs/kit";
import { prisma } from "$lib/db";
// const authorizedRoles - Not an admin gate, therefore all authenticated roles are authorized.
import type { LayoutServerLoad } from './$types';
import { error } from '@sveltejs/kit';
import { prisma } from '$lib/db';
export const load: LayoutServerLoad = async ({ locals }) => {
const user = await prisma.user.findUnique({ where: { id: locals.user?.id } });
if (!user) {
throw error(403, "not authorized");
}
}
const user = await prisma.user.findUnique({ where: { id: locals.user?.id } });
if (!user) {
throw error(403, 'not authorized');
}
};