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

@ -188,7 +188,7 @@ import { BaseSidebar } from './BaseSidebar'
import { NavigationItem } from './types'
export function LogistSidebar() {
const { user } = useAuth()
const { user } = useAuthContext()
const pathname = usePathname()
const { isCollapsed, toggleSidebar } = useSidebar()
@ -284,7 +284,7 @@ import { WholesaleSidebar } from './WholesaleSidebar'
import { LogistSidebar } from './LogistSidebar'
export function Sidebar() {
const { user } = useAuth()
const { user } = useAuthContext()
if (!user?.organization?.type) {
return (