update oauth

This commit is contained in:
lendry
2026-06-25 14:23:55 +03:00
parent c3e06e03cf
commit 1796008a28
21 changed files with 340 additions and 64 deletions

View File

@@ -1,5 +1,22 @@
import { redirect } from 'next/navigation';
'use client';
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useAuth } from '@/components/id/auth-provider';
import { getAdminLandingPath } from '@/lib/admin-access';
export default function AdminIndexPage() {
redirect('/admin/users');
const router = useRouter();
const { user, isLoading } = useAuth();
useEffect(() => {
if (isLoading || !user) return;
router.replace(getAdminLandingPath(user));
}, [isLoading, router, user]);
return (
<div className="flex min-h-[40vh] items-center justify-center text-[#667085]">
Перенаправление в админ-панель...
</div>
);
}