wire auth api

This commit is contained in:
Yisroel Baum 2026-05-23 23:21:07 +03:00
parent 9e70fae38d
commit eff7c5c281
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
12 changed files with 137 additions and 19 deletions

View file

@ -20,7 +20,7 @@ export const useAuthStore = defineStore('auth', () => {
isSubmitting.value = true
try {
const response = await fetch(`${API_BASE_URL}/login`, {
const response = await fetch(`${API_BASE_URL}/api/login`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
credentials: 'include',
@ -46,7 +46,7 @@ export const useAuthStore = defineStore('auth', () => {
async function fetchUser(): Promise<void> {
try {
const response = await fetch(`${API_BASE_URL}/me`, {
const response = await fetch(`${API_BASE_URL}/api/me`, {
credentials: 'include',
})
@ -64,7 +64,7 @@ export const useAuthStore = defineStore('auth', () => {
async function logout(): Promise<void> {
try {
await fetch(`${API_BASE_URL}/logout`, {
await fetch(`${API_BASE_URL}/api/logout`, {
method: 'POST',
credentials: 'include',
})