some style changes and cookies persistance added
This commit is contained in:
@@ -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,
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user