fix null check for layout data during error scenarios
This commit is contained in:
parent
e5dec76a84
commit
14819f0b73
1 changed files with 2 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue