Commit Graph

2 Commits

Author SHA1 Message Date
ca4d44d090 feat: implement direct routing to eliminate double redirects after registration
Replace dashboard intermediate routing with direct role-based navigation to improve UX
and reduce registration flow time from 4-5 seconds to 2-3 seconds.

Key Changes:
- Add routing utility lib/routing.ts with getHomePathFromUser function
- Update auth-flow.tsx, app/page.tsx, login/page.tsx to use direct routing
- Remove dashboard route and redirect components (3 files)
- Preserve critical components: sidebar/ and user-settings/ (43 dependencies)
- Fix breadcrumbs in seller/warehouse and fulfillment-supplies layouts
- Add comprehensive documentation and test coverage

Route Mapping:
- FULFILLMENT → /fulfillment/home
- SELLER → /seller/home
- LOGIST → /logistics/home
- WHOLESALE → /wholesale/home
- Fallback → /register

Testing:
- 8 comprehensive tests passed
- All routing scenarios validated
- Production build successful
- Critical components verified

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 18:46:22 +03:00
24a6ff74b5 feat: migrate from useAuth to AuthContext for centralized auth state
• Полная миграция 64 компонентов с useAuth на AuthContext
• Исправлена race condition в SMS регистрации
• Улучшена SSR совместимость с таймаутами
• Удалена дублирующая система регистрации
• Обновлена документация архитектуры аутентификации

Технические изменения:
- AuthContext.tsx: централизованная система состояния
- auth-flow.tsx: убрана агрессивная логика logout
- confirmation-step.tsx: исправлена передача телефона
- page.tsx: добавлена синхронизация состояния
- 64 файла: миграция useAuth → useAuthContext

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-19 17:21:52 +03:00