Fix rate limit UX and decrease lockout time

This commit is contained in:
Jannik committed 2026-09-20 22:00:15 +02:00
1 parent c652a19a43
commit 304a30c7c2
2 files changed
+8 -2

No files matched your search

+6 -1
View File
@@ -24,7 +24,11 @@ export default function AdminLoginPage() {
if (res.ok) {
router.push('/admin');
} else {
setError('Falsches Passwort');
if (res.status === 429) {
setError('Zu viele Fehlversuche! Bitte warte 3 Minuten.');
} else {
setError('Falsches Passwort');
}
}
} catch (err) {
setError('Ein Fehler ist aufgetreten');
@@ -56,3 +60,4 @@ export default function AdminLoginPage() {
</div>
);
}
+2 -1
View File
@@ -33,7 +33,7 @@ export interface RateLimitConfig {
export const RATE_LIMITS = {
login: {
maxRequests: 5,
windowSeconds: 15 * 60, // 15 minutes
windowSeconds: 3 * 60, // 3 minutes
prefix: 'rl:login',
},
like: {
@@ -140,3 +140,4 @@ export function addRateLimitHeaders(
headers.set('Retry-After', Math.ceil((result.resetAt.getTime() - Date.now()) / 1000).toString());
}
}