diff --git a/src/routes/idaa/(idaa)/bb/+page.ts b/src/routes/idaa/(idaa)/bb/+page.ts index 9649efda..c3a2fcab 100644 --- a/src/routes/idaa/(idaa)/bb/+page.ts +++ b/src/routes/idaa/(idaa)/bb/+page.ts @@ -4,6 +4,8 @@ console.log(`ae_idaa_bulletin_board [root] +page.ts start`); import { error } from '@sveltejs/kit'; import { browser } from '$app/environment'; +import { get } from 'svelte/store'; +import { idaa_loc } from '$lib/stores/ae_idaa_stores'; import { posts_func } from '$lib/ae_posts/ae_posts_functions'; export const load = (async ({ params, parent }) => { @@ -29,6 +31,14 @@ export const load = (async ({ params, parent }) => { } if (browser) { + // Auth gate: do not fetch or cache IDAA posts for unauthenticated users. + // +page.ts runs before +layout.svelte effects — without this check, the API call + // fires and writes to IDB before the layout's purge can run. + if (!get(idaa_loc).novi_verified) { + console.log('IDAA BB +page.ts: novi_verified=false — skipping post fetch.'); + return data; + } + const load_post_obj_li = posts_func .load_ae_obj_li__post({ api_cfg: ae_acct.api,