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 }; }