web/docs/auth-architecture.md
The application uses AuthContext for authentication state management, not React Query's useCurrentUserQuery. This is an intentional architectural decision.
main.tsx)currentUser throughout the appAuthContext.tsx)useNotifications() can still use the cached user data// With AuthContext (current)
const user = useCurrentUser(); // Always returns User | undefined
// With React Query (alternative)
const { data: user, isLoading } = useCurrentUserQuery();
if (isLoading) return <Spinner />;
// Need loading handling everywhere
Consider migrating auth to React Query if:
For Memos (a notes app where user profile rarely changes), AuthContext is the right choice.
The unused useCurrentUserQuery() hook in useUserQueries.ts is kept for potential future use. If requirements change (e.g., real-time collaboration on user profiles), migration path is clear:
useCurrentUserQuery() everywhereKeep the current AuthContext approach. It provides better DX and performance for this use case.