fix: panics if user not logged in

This commit is contained in:
Roman Godmaire 2023-11-19 15:26:31 -05:00
parent bb93de3074
commit 885f319565

View file

@ -2,6 +2,8 @@ import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ locals: { authReq, database } }) => {
const session = await authReq.validate();
if (!session) return {};
const tracks = await database.listTracksWithProducer(session.user.userId);
return {