diff --git a/composables/auth.js b/composables/auth.js index 50c06b01f..43b244050 100644 --- a/composables/auth.js +++ b/composables/auth.js @@ -20,10 +20,10 @@ export const initAuth = async (oldToken = null) => { } const route = useRoute() const authCookie = useCookie('auth-token', { + maxAge: 60 * 60 * 24 * 365 * 10, + sameSite: 'lax', secure: true, - sameSite: 'Strict', httpOnly: false, - expires: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000), path: '/', }) diff --git a/composables/cosmetics.js b/composables/cosmetics.js index 82c645e31..4ff876aff 100644 --- a/composables/cosmetics.js +++ b/composables/cosmetics.js @@ -2,7 +2,7 @@ export const useCosmetics = () => useState('cosmetics', () => { const cosmetics = useCookie('cosmetics', { maxAge: 60 * 60 * 24 * 365 * 10, - sameSite: 'Strict', + sameSite: 'lax', secure: true, httpOnly: false, path: '/', @@ -36,7 +36,7 @@ export const saveCosmetics = () => { const cosmeticsCookie = useCookie('cosmetics', { maxAge: 60 * 60 * 24 * 365 * 10, - sameSite: 'Strict', + sameSite: 'lax', secure: true, httpOnly: false, path: '/', diff --git a/composables/theme.js b/composables/theme.js index b5d8d9d97..dfc6acc0e 100644 --- a/composables/theme.js +++ b/composables/theme.js @@ -2,7 +2,7 @@ export const useTheme = () => useState('theme', () => { const colorMode = useCookie('color-mode', { maxAge: 60 * 60 * 24 * 365 * 10, - sameSite: 'Strict', + sameSite: 'lax', secure: true, httpOnly: false, path: '/', @@ -27,7 +27,7 @@ export const updateTheme = (value, updatePreference = false) => { const themeCookie = useCookie('color-mode', { maxAge: 60 * 60 * 24 * 365 * 10, - sameSite: 'Strict', + sameSite: 'lax', secure: true, httpOnly: false, path: '/', diff --git a/helpers/package.js b/helpers/package.js index dc26cd888..2c77cb81b 100644 --- a/helpers/package.js +++ b/helpers/package.js @@ -137,8 +137,6 @@ export const createDataPackVersion = async function ( primaryZipReader.file('quilt.mod.json', JSON.stringify(quiltModJson)) } if (loaders.includes('forge')) { - console.log(forgeModsToml) - console.log(TOML.stringify(forgeModsToml, { newline: '\n' })) primaryZipReader.file('META-INF/mods.toml', TOML.stringify(forgeModsToml, { newline: '\n' })) } diff --git a/plugins/1.theme.js b/plugins/1.theme.js index 029130a95..3ccef1792 100644 --- a/plugins/1.theme.js +++ b/plugins/1.theme.js @@ -20,6 +20,5 @@ export default defineNuxtPlugin((nuxtApp) => { // colorSchemeQueryList.addEventListener('change', setColorScheme) // } // }) - nuxtApp.provide('colorMode', themeStore.value) }) diff --git a/server/plugins/theme.js b/server/plugins/theme.js index 55324f7a8..b0f6ab623 100644 --- a/server/plugins/theme.js +++ b/server/plugins/theme.js @@ -9,5 +9,26 @@ export default defineNitroPlugin((nitroApp) => { } else { html.htmlAttrs.push(`class="dark-mode"`) } + + // Reset cookie attributes to correct ones + if (cookies) { + const opts = { + maxAge: 60 * 60 * 24 * 365 * 10, + sameSite: 'lax', + secure: true, + httpOnly: false, + path: '/', + } + + if (cookies['auth-token']) { + setCookie(event, 'auth-token', cookies['auth-token'], opts) + } + if (cookies['color-mode']) { + setCookie(event, 'color-mode', cookies['color-mode'], opts) + } + if (cookies.cosmetics) { + setCookie(event, 'cosmetics', cookies.cosmetics, opts) + } + } }) })