Support authenticated users in stats and page loading

This commit is contained in:
George Powell
2026-02-05 17:46:53 -05:00
parent 86f81cf9dd
commit 96024d5048
3 changed files with 35 additions and 11 deletions

View File

@@ -34,14 +34,16 @@ async function getTodayVerse(): Promise<DailyVerse> {
return inserted;
}
export const load: PageServerLoad = async () => {
export const load: PageServerLoad = async ({ locals }) => {
const dailyVerse = await getTodayVerse();
const correctBook = getBookById(dailyVerse.bookId) ?? null;
return {
dailyVerse,
correctBookId: dailyVerse.bookId,
correctBook
correctBook,
user: locals.user,
session: locals.session
};
};