Update project 10 FRONT TICKET QR 2
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user