mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 22:18:12 +00:00
feat(freight:backoffice): added login page and basic authorization
This commit is contained in:
23
apps/edr-freight-web/backoffice/src/auth/api.ts
Normal file
23
apps/edr-freight-web/backoffice/src/auth/api.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
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>("/auth/me");
|
||||
return response.data;
|
||||
};
|
||||
Reference in New Issue
Block a user