mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-07-17 21:20:15 -04:00
fix: Fix embedded tokens not persisting across sessions (#7860)
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
export function getTokenCookieOptions() {
|
||||
const isSecureConnection = useNuxtApp().$appInfo.production && window?.location?.protocol === "https:";
|
||||
const { $appInfo } = useNuxtApp();
|
||||
|
||||
const isSecureConnection = $appInfo.production && window?.location?.protocol === "https:";
|
||||
const isEmbedded = isSecureConnection && window?.self !== window?.top;
|
||||
|
||||
return {
|
||||
maxAge: useNuxtApp().$appInfo.tokenTime * 60 * 60,
|
||||
maxAge: $appInfo.tokenTime * 60 * 60,
|
||||
secure: isSecureConnection,
|
||||
sameSite: (isSecureConnection ? "none" : "lax") as "none" | "lax",
|
||||
partitioned: isSecureConnection,
|
||||
sameSite: (isEmbedded ? "none" : "lax") as "none" | "lax",
|
||||
partitioned: isEmbedded,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user