feat(freight:backoffice): added login page and basic authorization

This commit is contained in:
Michael Abebe
2026-05-22 17:55:20 +03:00
parent 2c9ca6f16b
commit 27e2cfcf6b
18 changed files with 918 additions and 227 deletions

View 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;
};