Update project 10 FRONT TICKET QR 2

This commit is contained in:
2026-03-06 15:41:29 +00:00
parent 1d709b1dd0
commit d19660b50c
5 changed files with 266 additions and 66 deletions

View File

@@ -14,6 +14,29 @@ apiClient.interceptors.request.use((config) => {
return config;
});
// ─── Auth ─────────────────────────────────────────────────────────────────────
interface LoginResponse {
access_token: string;
token_type: string;
}
/**
* POST /auth/login
* Returns a Bearer access token on success.
* Throws AxiosError 401 for invalid credentials, 422 for validation errors.
*/
export async function loginApi(
email: string,
password: string
): Promise<{ access_token: string }> {
const response = await apiClient.post<LoginResponse>("/auth/login", {
email,
password,
});
return { access_token: response.data.access_token };
}
// ─── Domain types (mirror backend schemas) ────────────────────────────────────
export interface TournamentInfo {