You've already forked AstralRinth
forked from didirus/AstralRinth
Fix authentication hydration issue (#1048)
* Fix authentication hydration issue * reset existing cookies * Update if statement chaining
This commit is contained in:
@@ -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: '/',
|
||||
})
|
||||
|
||||
|
||||
@@ -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: '/',
|
||||
|
||||
@@ -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: '/',
|
||||
|
||||
Reference in New Issue
Block a user