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:
co-authored by
Claude Opus 5.5
parent
e034da2458
commit
d4b0f881a4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user