Add new frontend - fix 13

This commit is contained in:
Urtzi Alfaro
2025-07-22 20:22:27 +02:00
parent 5dffe39706
commit dd05f3a0f5
5 changed files with 21 additions and 7 deletions

View File

@@ -50,14 +50,20 @@ export class AuthService {
/**
* User registration
*/
async register(userData: RegisterRequest): Promise<UserProfile> {
const response = await apiClient.post<ApiResponse<UserProfile>>(
async register(userData: RegisterRequest): Promise<TokenResponse> {
const response = await apiClient.post<ApiResponse<TokenResponse>>(
'/auth/register',
userData
);
return response.data!;
// Store tokens after successful registration
const tokenData = response.data!;
await tokenManager.storeTokens(tokenData);
return tokenData;
}
/**
* Refresh access token
*/