refactor: remove useAutoLogin from multiple components
Merged
AH
6mo ago+14+14+01234567890123456789-19-19-01234567890123456789
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
useAutoLoginfromCatalogSongsPage,CatalogsPage,TasksPage,NewChatBootstrap, and Chat; droppedLegacyAutoLoginincomponents/VercelChat/chat.tsx(also fixed an unimported reference). Auto-login now runs once inproviders/UserProvder.tsxviaUserAutoLogin, anduseAutoLoginis documented to run underUserProvider.
- Removed
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.