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:
@ -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__) {
|
||||
|
Reference in New Issue
Block a user