refactor: remove useAutoLogin from multiple components

Merged
AH
6mo ago
+14-19

This commit removes the useAutoLogin hook from CatalogSongsPage, CatalogsPage, TasksPage, and Chat components, streamlining the codebase by eliminating unnecessary calls. The UserProvider component now includes useAutoLogin to manage user authentication more effectively.


Summary by cubic

Centralized auto-login by moving useAutoLogin into the app’s UserProvider via UserAutoLogin. Removes duplicate calls and initializes auth once across pages and chat (including the legacy route).

  • Refactors
    • Removed useAutoLogin from CatalogSongsPage, CatalogsPage, TasksPage, NewChatBootstrap, and Chat; dropped LegacyAutoLogin in components/VercelChat/chat.tsx (also fixed an unimported reference). Auto-login now runs once in providers/UserProvder.tsx via UserAutoLogin, and useAutoLogin is documented to run under UserProvider.

Summary by CodeRabbit

  • Refactor
    • Reorganized auto-login functionality to run at the app provider level rather than on individual pages, improving code maintainability while preserving existing sign-in behavior for anonymous visitors.