mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-27 16:40:56 +00:00
24 lines
606 B
TypeScript
24 lines
606 B
TypeScript
import { api } from "./http";
|
|
import type { AuthTokens, AuthUser, LoginResponse } from "./types";
|
|
|
|
export const loginRequest = async (payload: {
|
|
email: string;
|
|
password: string;
|
|
}) => {
|
|
const response = await api.post<LoginResponse>("/auth/login", payload);
|
|
return response.data;
|
|
};
|
|
|
|
export const verifyMfaRequest = async (payload: {
|
|
email: string;
|
|
otp: string;
|
|
}) => {
|
|
const response = await api.post<AuthTokens>("/auth/mfa-verify", payload);
|
|
return response.data;
|
|
};
|
|
|
|
export const getMeRequest = async () => {
|
|
const response = await api.get<AuthUser>("/me");
|
|
return response.data;
|
|
};
|