diff --git a/client-web/src/modules/auth/infrastructure/authApi.ts b/client-web/src/modules/auth/infrastructure/authApi.ts index 1bbd788..f918efb 100644 --- a/client-web/src/modules/auth/infrastructure/authApi.ts +++ b/client-web/src/modules/auth/infrastructure/authApi.ts @@ -3,7 +3,7 @@ import type { User } from '../../../core/domain/types'; export class AuthApi { static async login(username: string, password: string) { - const response = await httpClient.request<{ accessToken: string; userId: string; username: string; displayName: string }>('/auth/login', { + const response = await httpClient.request('/auth/login', { method: 'POST', body: JSON.stringify({ username, password }), }); @@ -16,12 +16,12 @@ export class AuthApi { username: response.username || (response as any).userName, displayName: response.displayName, avatar: response.avatar || null - } as User + } as unknown as User }; } static async register(username: string, displayName: string, password: string, bio?: string) { - const response = await httpClient.request<{ accessToken: string; userId: string; username: string; displayName: string }>('/auth/register', { + const response = await httpClient.request('/auth/register', { method: 'POST', body: JSON.stringify({ username, displayName, password, bio }), }); @@ -34,7 +34,7 @@ export class AuthApi { username: response.username || (response as any).userName, displayName: response.displayName, avatar: response.avatar || null - } as User + } as unknown as User }; } @@ -47,7 +47,7 @@ export class AuthApi { username: response.username || response.userName, displayName: response.displayName, avatar: response.avatar || response.avatarUrl - } as User, + } as unknown as User, token: response.accessToken }; }