mirror of
https://github.com/jcreek/LivingDexTracker.git
synced 2026-09-18 19:42:04 +00:00
b7d2db4959
@supabase/ssr 0.1.0 never removed the old unchunked session cookie once a refreshed session grew past one cookie, and always read that stale copy first. Every load then retried an already-used refresh token, which the hosted auth server rejects, signing the user out. Upgrade @supabase/ssr to 0.12 (and supabase-js to match) and move to the getAll/setAll cookie API, which clears stale chunks when writing.
13 lines
342 B
TypeScript
13 lines
342 B
TypeScript
import type { LayoutServerLoad } from './$types';
|
|
|
|
export const load: LayoutServerLoad = async ({ locals: { safeGetSession }, cookies }) => {
|
|
const { session, user } = await safeGetSession();
|
|
|
|
return {
|
|
session,
|
|
user,
|
|
// The universal layout load rebuilds a server-side client from these during SSR.
|
|
cookies: cookies.getAll()
|
|
};
|
|
};
|