busqueda page: loading products spinner & endopoints tests

This commit is contained in:
María
2025-08-26 15:01:13 +02:00
parent 4462fe0a4d
commit a9a525d858
2 changed files with 77 additions and 28 deletions

View File

@@ -1,5 +1,5 @@
// stores/auth.ts
import { defineStore } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
export const useAuthStore = defineStore('auth', {
state: () => ({
@@ -11,7 +11,25 @@ export const useAuthStore = defineStore('auth', {
role: 'ANON' as string,
cookiesAreAccepted: false,
}),
//persist: true, // TODO: Enable persistence. Cookies will be stored 'auth'
//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',
// 'refresh',
// 'cookiesAreAccepted',
// ],
// },
getters: {
isAuthenticated: (state) => !!state.access,
isUser: (state) => state.role === 'SHOP_USER',