fix: refactor cookie settings for Home Assistant i-frame login (#7741)

This commit is contained in:
cheebreezee
2026-06-15 07:08:35 -07:00
committed by GitHub
parent ecb6caf71b
commit 544071f3e7
3 changed files with 13 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
export function getTokenCookieOptions(): Parameters<typeof useCookie>[1] {
const isSecureConnection = useNuxtApp().$appInfo.production && window?.location?.protocol === "https:";
return {
maxAge: useNuxtApp().$appInfo.tokenTime * 60 * 60,
secure: isSecureConnection,
sameSite: isSecureConnection ? "none" : "lax",
partitioned: isSecureConnection,
};
}