Add subcription feature 6
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user