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>
This commit is contained in:
Veronika Smirnova
2025-09-19 17:21:52 +03:00
parent d19530a985
commit 24a6ff74b5
91 changed files with 3626 additions and 7296 deletions

View File

@ -260,7 +260,7 @@ export const logistNavigation: LogistNavigationItem[] = [
```typescript
export function LogistSidebar() {
const { user, logout } = useAuth()
const { user, logout } = useAuthContext()
const router = useRouter()
const pathname = usePathname()
const { isCollapsed, toggleSidebar } = useSidebar()
@ -324,7 +324,7 @@ export function LogistSidebar() {
```typescript
export function Sidebar({ isRootInstance = false }: { isRootInstance?: boolean } = {}) {
const { user } = useAuth()
const { user } = useAuthContext()
// Защита от дубликатов
if (typeof window !== 'undefined' && !isRootInstance && window.__SIDEBAR_ROOT_MOUNTED__) {