staging-tester / ocean-landing-serve / src/ routes/ account/ +page.ts
import { redirect } from '@sveltejs/kit';
import { loadAccount } from '#lib/live/account.svelte.js';
import { loadMe } from '#lib/live/identity.svelte.js';
import type { PageLoad } from './$types';
// Rendered from the signed-in account in the browser; signed out goes to sign-in and back here.
export const ssr = false;
export const load: PageLoad = async ({ url }) => {
if (!(await loadMe())) redirect(307, `/sign-in?next=${encodeURIComponent(url.pathname)}`);
await loadAccount();
};