fix integration
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user