mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-06-16 22:10:13 -04:00
fix: refactor cookie settings for Home Assistant i-frame login (#7741)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ref, computed } from "vue";
|
||||
import type { UserOut } from "~/lib/api/types/user";
|
||||
import { clearAllStores } from "~/composables/store";
|
||||
import { getTokenCookieOptions } from "~/composables/use-token-cookie";
|
||||
|
||||
interface AuthData {
|
||||
value: UserOut | null;
|
||||
@@ -30,10 +31,7 @@ export const useAuthBackend = function (): AuthState {
|
||||
|
||||
const runtimeConfig = useRuntimeConfig();
|
||||
const tokenName = runtimeConfig.public.AUTH_TOKEN;
|
||||
const tokenCookie = useCookie(tokenName, {
|
||||
maxAge: $appInfo.tokenTime * 60 * 60,
|
||||
secure: $appInfo.production && window?.location?.protocol === "https:",
|
||||
});
|
||||
const tokenCookie = useCookie(tokenName, getTokenCookieOptions());
|
||||
|
||||
function setToken(token: string | null) {
|
||||
tokenCookie.value = token;
|
||||
|
||||
Reference in New Issue
Block a user