keepme / src /services /api /authService.ts
narinder1231's picture
Add axios client with request/response interceptors for authentication
75706d4
raw
history blame contribute delete
440 Bytes
import axiosClient from "./axiosClient";
import { ILogin, ILoginResponse, IRegister, IRegisterResponse } from "../../interfaces/auth";
export const register = async (data: IRegister) =>
await axiosClient.post<IRegisterResponse>("/auth/register", data);
export const login = async (data: ILogin) =>
await axiosClient.post<ILoginResponse>("/auth/login", data);
export const logout = async () => await axiosClient.post("/auth/logout");