/** * Authentication API */ import axios from 'axios'; import { API_BASE_URL } from '../config/api'; import type { LoginCredentials, AuthResponse, User } from '../types'; import apiClient from './client'; // Login uses the main auth endpoint, not the mobile API const authAxios = axios.create({ baseURL: API_BASE_URL, timeout: 30000, headers: { 'Content-Type': 'application/json', }, }); export async function loginApi(credentials: LoginCredentials): Promise { const response = await authAxios.post('/auth/login/', credentials); return response.data; } export async function getProfile(): Promise { const response = await apiClient.get('/me/'); return response.data; } export async function logoutApi(): Promise { try { await apiClient.post('/logout/'); } catch (error) { // Ignore logout errors } }