import { decodeAuthCookieOrNull } from "$lib/Effect/authCookie"; import { encryptFeedToken } from "$lib/Utility/feedToken"; // Mint the RSS feed token server-side: the encryption key never reaches the // client, so the URL is built here from the refresh token already in the cookie // rather than from tokens handed to the browser. export const load = async ({ cookies }) => { const cookie = cookies.get("user"); const user = cookie ? decodeAuthCookieOrNull(cookie) : null; return { feedToken: user ? await encryptFeedToken(user.refreshToken) : undefined, }; };