some style changes and cookies persistance added

This commit is contained in:
María
2025-10-06 14:22:30 +02:00
parent f5f4f4529a
commit b945bf0673
12 changed files with 30 additions and 35 deletions

View File

@@ -1,5 +1,4 @@
import { defineStore } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
export const useAuthStore = defineStore('auth', {
state: () => ({
@@ -12,25 +11,6 @@ export const useAuthStore = defineStore('auth', {
cookiesAreAccepted: false,
}),
//persist: true, // TODO: Enable persistence. Cookies will be stored 'auth' 👉🏻 https://prazdevs.github.io/pinia-plugin-persistedstate/frameworks/nuxt
// persist: {
// key: 'authentication-cookie',
// storage: piniaPluginPersistedstate.cookies({
// expires: 14,
// sameSite: 'strict',
// secure: !import.meta.dev,
// }),
// paths: [
// 'id',
// 'name',
// 'email',
// 'role',
// 'access',
// 'refreshTokens',
// 'cookiesAreAccepted',
// ],
// },
getters: {
isAuthenticated: (state) => !!state.access,
@@ -103,5 +83,7 @@ export const useAuthStore = defineStore('auth', {
this.refreshTokens = payload.refresh
}
}
}
})
},
persist: true,
}
)