Harden login, sessions, and media access before the dev deploy.
Deploy Development / deploy (push) Successful in 49s
Test Suite / pytest-backend (push) Successful in 47s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 15s
Test Suite / k6 /health Baseline (push) Successful in 35s
Test Suite / playwright-tests (push) Failing after 5m43s

Limit brute-force attempts, require admin TOTP, and keep session tokens out of media URLs.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-13 07:45:53 +02:00
1 parent 6c7c24e887
commit 32b28a93f3
31 files changed
+1146 -101

No files matched your search

+28
View File
@@ -21,6 +21,7 @@ import AdminHomeRedirect from './components/AdminHomeRedirect'
import PlatformAdminRoute from './components/PlatformAdminRoute'
import ActiveClubSwitcher from './components/ActiveClubSwitcher'
import InactiveMembershipBanner from './components/InactiveMembershipBanner'
import TotpSetupCard from './components/TotpSetupCard'
import './app.css'
const OnboardingPage = lazyWithRetry(() => import('./pages/OnboardingPage'))
@@ -126,6 +127,29 @@ function Nav({ showAdminNav, onboardingOnly }) {
)
}
function TotpEnrollGate() {
const { checkAuth, logout } = useAuth()
return (
<div className="page-padding" style={{ maxWidth: 520, margin: '2rem auto' }}>
<h1 style={{ fontSize: '1.4rem' }}>Zwei-Faktor einrichten</h1>
<p style={{ color: 'var(--text2)' }}>
Plattform-Admins melden sich erst an, wenn ein Authenticator eingerichtet ist.
</p>
<TotpSetupCard onEnabled={() => checkAuth()} />
<button
type="button"
className="btn btn-secondary"
onClick={async () => {
await logout()
window.location.href = '/login'
}}
>
Abmelden
</button>
</div>
)
}
function ProtectedLayout() {
const { isAuthenticated, loading, user, logout } = useAuth()
@@ -155,6 +179,10 @@ function ProtectedLayout() {
return <Navigate to="/login" replace />
}
if (user?.totpEnrollmentRequired) {
return <TotpEnrollGate />
}
const location = useLocation()
const onboardingOnly = isOnboardingRestricted(user)
if (onboardingOnly && !isOnboardingAllowedPath(location.pathname)) {