fix null check for layout data during error scenarios

This commit is contained in:
Justin Edmund 2025-12-13 21:18:50 -08:00
parent e5dec76a84
commit 14819f0b73

View file

@ -13,7 +13,8 @@ import { authStore } from '$lib/stores/auth.store'
export const load: LayoutLoad = async ({ data }) => {
// Initialize auth store from server data BEFORE creating QueryClient
if (browser && data.auth) {
// Defensive check: data might be null/undefined during error scenarios
if (browser && data?.auth) {
authStore.initFromServer(
data.auth.accessToken,
data.auth.user,