This commit is contained in:
nquidox 2025-10-29 20:58:16 +03:00
parent 30c4232406
commit 53558c4b46

View file

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import { computed, ref } from 'vue'
import { computed, nextTick, ref } from 'vue'
import { apiClient } from '@/services/apiClient'
import router from '@/router/index.js'
@ -54,6 +54,7 @@ export const useAuthStore = defineStore('auth', () => {
try {
const response = await apiClient.post('/user/auth/login', { email, password })
setToken(response.data.access_token)
await nextTick()
router.push({ name: 'collection'})
} catch (error) {
console.error('Login error:', error)