ready to deployment

This commit is contained in:
2025-08-10 21:50:14 +02:00
commit 1efb04b057
37 changed files with 7379 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
// src/stores/authStore.js
import { defineStore } from 'pinia'
import { login } from '@/api/authApi'
export const useAuthStore = defineStore('auth', {
state: () => ({
token: localStorage.getItem('token') || null,
}),
actions: {
async loginUser(email, password) {
const data = await login(email, password)
this.token = data.access_token
localStorage.setItem('token', this.token)
},
logout() {
this.token = null
localStorage.removeItem('token')
},
isAuthenticated() {
return !!this.token
},
},
})