protected-route-fix
All checks were successful
Deploy on push / deploy (push) Successful in 3m2s

This commit is contained in:
2025-09-29 15:54:22 +03:00
parent 8e944e399a
commit f2398d3592
4 changed files with 114 additions and 16 deletions

View File

@@ -29,9 +29,19 @@ export const ProtectedRoute = () => {
<Show
when={auth.isAuthenticated()}
fallback={
<div class="loading-screen">
<div class="loading-spinner" />
<div>Перенаправление на страницу входа...</div>
<div class="auth-error-screen">
<div class="auth-error-content">
<h2>Доступ запрещен</h2>
<p>У вас нет прав доступа к админ-панели или ваша сессия истекла.</p>
<div class="auth-error-actions">
<button class="btn btn-primary" onClick={() => (window.location.href = '/login')}>
Войти в аккаунт
</button>
<button class="btn btn-secondary" onClick={() => auth.logout()}>
Выйти из текущего аккаунта
</button>
</div>
</div>
</div>
}
>