From 56f75ae32b596bcac3951ffa1a79bc435fc5ef14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Fri, 17 Apr 2026 00:33:45 +0300 Subject: [PATCH 1/2] =?UTF-8?q?=D0=9F=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=84=D0=B8=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/auth/infrastructure/authApi.ts | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/client-web/src/modules/auth/infrastructure/authApi.ts b/client-web/src/modules/auth/infrastructure/authApi.ts index babc2e9..1bbd788 100644 --- a/client-web/src/modules/auth/infrastructure/authApi.ts +++ b/client-web/src/modules/auth/infrastructure/authApi.ts @@ -11,10 +11,11 @@ export class AuthApi { return { token: response.accessToken, user: { - id: response.userId, - username: response.username, + ...response, + id: response.userId || (response as any).id, + username: response.username || (response as any).userName, displayName: response.displayName, - avatar: null + avatar: response.avatar || null } as User }; } @@ -28,22 +29,24 @@ export class AuthApi { return { token: response.accessToken, user: { - id: response.userId, - username: response.username, + ...response, + id: response.userId || (response as any).id, + username: response.username || (response as any).userName, displayName: response.displayName, - avatar: null + avatar: response.avatar || null } as User }; } static async getMe() { - const response = await httpClient.request<{ userId: string; username: string; displayName: string; avatar: string | null; accessToken?: string }>('/auth/me'); + const response = await httpClient.request('/auth/me'); return { user: { - id: response.userId, - username: response.username, + ...response, + id: response.userId || response.id, + username: response.username || response.userName, displayName: response.displayName, - avatar: response.avatar + avatar: response.avatar || response.avatarUrl } as User, token: response.accessToken }; From c264b7df27c6def495ccc3aea6455a15242b1b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A5=D0=B0=D0=BB=D0=B8=D0=BC=D0=BE=D0=B2=20=D0=A0=D1=83?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D0=BC?= Date: Fri, 17 Apr 2026 00:37:37 +0300 Subject: [PATCH 2/2] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B8=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=BF=D0=B8=D0=BB=D1=8F=D1=86=D0=B8=D0=B8=20TypeScript?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client-web/src/modules/auth/infrastructure/authApi.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 }; }