fix integration

This commit is contained in:
2025-06-05 21:40:30 +02:00
parent 3bd3b9b70d
commit 48cf5cd6c4
9 changed files with 92 additions and 33 deletions

View File

@@ -3,7 +3,7 @@ import {createJSONStorage, persist} from "zustand/middleware";
import AsyncStorage from "@react-native-async-storage/async-storage";
import axios from "axios";
const API_URL = "http://10.0.2.2:8080/api/v1";
const API_URL = "https://testowe.zikor.pl/api/v1";
export const useAuthStore = create(
persist(
@@ -71,8 +71,10 @@ export const useAuthStore = create(
signOut: async () => {
try {
const {token} = useAuthStore.getState();
const headers = token ? { 'Authorization': `Bearer ${token}` } : {};
// Можно отправить запрос на бэкенд для инвалидации токена
await axios.post(`${API_URL}/auth/logout`);
await axios.post(`${API_URL}/auth/logout`, {}, { headers });
} catch (error) {
console.error("Logout error:", error);
} finally {