From 7b251686b21c0fb287b48da8b3bd6e35fc6424e7 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:43:07 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=B3=D1=80=D1=83?= =?UTF-8?q?=D0=B7=D0=BA=D0=B8=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=BF=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 | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/client-web/src/modules/auth/infrastructure/authApi.ts b/client-web/src/modules/auth/infrastructure/authApi.ts index f918efb..17a4888 100644 --- a/client-web/src/modules/auth/infrastructure/authApi.ts +++ b/client-web/src/modules/auth/infrastructure/authApi.ts @@ -39,16 +39,22 @@ export class AuthApi { } static async getMe() { - const response = await httpClient.request('/auth/me'); + const authRes = await httpClient.request('/auth/me'); + const userId = authRes.userId || authRes.id; + + // Пытаемся получить расширенный профиль (био, дата рождения) + const profileRes = await httpClient.request(`/profiles/${userId}`).catch(() => ({})); + return { user: { - ...response, - id: response.userId || response.id, - username: response.username || response.userName, - displayName: response.displayName, - avatar: response.avatar || response.avatarUrl + ...authRes, + ...profileRes, + id: userId, + username: authRes.username || authRes.userName || profileRes.userName, + displayName: authRes.displayName || profileRes.displayName, + avatar: authRes.avatar || authRes.avatarUrl || profileRes.avatarUrl } as unknown as User, - token: response.accessToken + token: authRes.accessToken }; }