2026-06-17 10:57:45 -05:00
|
|
|
export function getTokenCookieOptions() {
|
2026-07-08 15:13:42 -05:00
|
|
|
const { $appInfo } = useNuxtApp();
|
|
|
|
|
|
|
|
|
|
const isSecureConnection = $appInfo.production && window?.location?.protocol === "https:";
|
|
|
|
|
const isEmbedded = isSecureConnection && window?.self !== window?.top;
|
|
|
|
|
|
2026-06-15 07:08:35 -07:00
|
|
|
return {
|
2026-07-08 15:13:42 -05:00
|
|
|
maxAge: $appInfo.tokenTime * 60 * 60,
|
2026-06-15 07:08:35 -07:00
|
|
|
secure: isSecureConnection,
|
2026-07-08 15:13:42 -05:00
|
|
|
sameSite: (isEmbedded ? "none" : "lax") as "none" | "lax",
|
|
|
|
|
partitioned: isEmbedded,
|
2026-06-15 07:08:35 -07:00
|
|
|
};
|
|
|
|
|
}
|