Add subcription feature 6

This commit is contained in:
Urtzi Alfaro
2026-01-16 15:19:34 +01:00
parent 6b43116efd
commit 4bafceed0d
35 changed files with 3826 additions and 1789 deletions

View File

@@ -30,7 +30,34 @@ import {
export class AuthService {
private readonly baseUrl = '/auth';
// User Profile (authenticated)
// Backend: services/auth/app/api/users.py
// ===================================================================
async getProfile(): Promise<UserResponse> {
// Get current user ID from auth store
const { useAuthStore } = await import('../../stores/auth.store');
const user = useAuthStore.getState().user;
if (!user?.id) {
throw new Error('User not authenticated or user ID not available');
}
return apiClient.get<UserResponse>(`${this.baseUrl}/users/${user.id}`);
}
async updateProfile(updateData: UserUpdate): Promise<UserResponse> {
// Get current user ID from auth store
const { useAuthStore } = await import('../../stores/auth.store');
const user = useAuthStore.getState().user;
if (!user?.id) {
throw new Error('User not authenticated or user ID not available');
}
return apiClient.put<UserResponse>(`${this.baseUrl}/users/${user.id}`, updateData);
}
// ATOMIC REGISTRATION: SetupIntent-First Approach
// These methods implement the secure registration flow with 3DS support
// ===================================================================
@@ -104,19 +131,6 @@ export class AuthService {
});
}
// ===================================================================
// User Profile (authenticated)
// Backend: services/auth/app/api/auth_operations.py
// ===================================================================
async getProfile(): Promise<UserResponse> {
return apiClient.get<UserResponse>(`${this.baseUrl}/me`);
}
async updateProfile(updateData: UserUpdate): Promise<UserResponse> {
return apiClient.put<UserResponse>(`${this.baseUrl}/me`, updateData);
}
// ===================================================================
// OPERATIONS: Email Verification
// Backend: services/auth/app/api/auth_operations.py