lib was accidentally being ignored
Some checks failed
CI/CD Pipeline / VM Test - backend-integration (push) Successful in 3s
CI/CD Pipeline / VM Test - full-stack (push) Successful in 3s
CI/CD Pipeline / VM Test - performance (push) Successful in 2s
CI/CD Pipeline / VM Test - security (push) Successful in 2s
CI/CD Pipeline / Backend Linting (push) Successful in 2s
CI/CD Pipeline / Frontend Linting (push) Failing after 12s
CI/CD Pipeline / Nix Flake Check (push) Successful in 37s
CI/CD Pipeline / CI Summary (push) Failing after 0s

This commit is contained in:
Danilo Reyes
2025-11-02 12:23:25 -06:00
parent 681fa0903b
commit c52ac86739
34 changed files with 4164 additions and 6 deletions

View File

@@ -0,0 +1,51 @@
/**
* Authentication API client methods
*/
import { apiClient } from './client';
export interface UserResponse {
id: string;
email: string;
created_at: string;
is_active: boolean;
}
export interface TokenResponse {
access_token: string;
token_type: string;
user: UserResponse;
}
export interface RegisterRequest {
email: string;
password: string;
}
export interface LoginRequest {
email: string;
password: string;
}
export const authApi = {
/**
* Register a new user
*/
async register(data: RegisterRequest): Promise<UserResponse> {
return apiClient.post<UserResponse>('/auth/register', data);
},
/**
* Login user and get JWT token
*/
async login(data: LoginRequest): Promise<TokenResponse> {
return apiClient.post<TokenResponse>('/auth/login', data);
},
/**
* Get current user information
*/
async getCurrentUser(): Promise<UserResponse> {
return apiClient.get<UserResponse>('/auth/me');
},
};