front-hub/src/api/auth.ts

15 lines
391 B
TypeScript
Raw Normal View History

2023-05-17 11:20:11 +00:00
import { authStore } from "@root/stores/makeRequest";
2023-05-30 18:34:41 +00:00
const apiUrl = process.env.NODE_ENV === "production" ? "" : "https://hub.pena.digital";
2023-05-17 11:20:11 +00:00
const makeRequest = authStore.getState().makeRequest;
export function logout() {
return makeRequest<never, void>({
2023-05-30 18:34:41 +00:00
url: apiUrl + "/auth/logout",
2023-05-17 11:20:11 +00:00
method: "POST",
2023-05-30 18:34:41 +00:00
useToken: true,
2023-05-17 11:20:11 +00:00
withCredentials: true,
});
}