Files
memegoat/frontend/src/services/auth.service.ts
Mathis HERRIOT 35abd0496e
Some checks failed
Deploy to Production / deploy (push) Failing after 2m20s
Lint / lint (push) Successful in 9m37s
refactor: apply consistent formatting to improve code quality
Ensure uniform code formatting across components by aligning with the established code style. Adjust imports, indentation, and spacing to enhance readability and maintainability.
2026-01-14 17:26:58 +01:00

25 lines
571 B
TypeScript

import api from "@/lib/api";
import type { LoginResponse, RegisterPayload } from "@/types/auth";
export const AuthService = {
async login(email: string, password: string): Promise<LoginResponse> {
const { data } = await api.post<LoginResponse>("/auth/login", {
email,
password,
});
return data;
},
async register(payload: RegisterPayload): Promise<void> {
await api.post("/auth/register", payload);
},
async logout(): Promise<void> {
await api.post("/auth/logout");
},
async refresh(): Promise<void> {
await api.post("/auth/refresh");
},
};