GET /api/auth/me отвечает 200 с user: null для гостя

Раньше был 401, из-за чего в консоли браузера у гостя появлялась ошибка
(Lighthouse Best Practices: errors-in-console).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
deonisii
2026-10-04 13:09:04 +03:00
co-authored by Claude Opus 5.5
parent e034da2458
commit d4b0f881a4
2 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ export function useAuth() {
queryKey: ['me'],
queryFn: async () => {
try {
const { user } = await api<{ user: UserDto }>('/auth/me');
const { user } = await api<{ user: UserDto | null }>('/auth/me');
return user;
} catch (e) {
if (e instanceof ApiError && e.status === 401) return null;