Fix infinite redirect loop: super_admin no longer redirects to /admin
The /admin route was removed when CP was moved to cp.hotelsync.ru. Logged-in super_admin sessions were causing a redirect loop to a non-existent route, resulting in a blank page on app.hotelsync.ru. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -43,8 +43,7 @@ function LoginForm({ onSwitch }: { onSwitch: () => void }) {
|
||||
const loggedIn = await login(email, password)
|
||||
setLoading(false)
|
||||
if (!loggedIn) { setError('Неверный email или пароль'); return }
|
||||
if (loggedIn.role === 'super_admin') navigate('/admin')
|
||||
else navigate('/calendar')
|
||||
navigate('/calendar')
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -470,7 +469,6 @@ export function LoginPage() {
|
||||
const [mode, setMode] = useState<'login' | 'register'>('login')
|
||||
|
||||
if (user) {
|
||||
if (user.role === 'super_admin') return <Navigate to="/admin" replace />
|
||||
return <Navigate to="/calendar" replace />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user