diff --git a/backend/src/controllers/authController.ts b/backend/src/controllers/authController.ts index b196db63..afa0d34f 100644 --- a/backend/src/controllers/authController.ts +++ b/backend/src/controllers/authController.ts @@ -121,6 +121,12 @@ export async function login(req: Request, res: Response): Promise { res.status(status).json({ error: clientErrorMessage(e, 'Login failed'), ...(code ? { code } : {}), + ...((e as { lockedUntil?: string }).lockedUntil + ? { lockedUntil: (e as { lockedUntil: string }).lockedUntil } + : {}), + ...((e as { retryAfterMinutes?: number }).retryAfterMinutes != null + ? { retryAfterMinutes: (e as { retryAfterMinutes: number }).retryAfterMinutes } + : {}), }); } } diff --git a/backend/src/controllers/securityController.ts b/backend/src/controllers/securityController.ts index cb834d50..791a6bec 100644 --- a/backend/src/controllers/securityController.ts +++ b/backend/src/controllers/securityController.ts @@ -207,6 +207,40 @@ export async function listFailedLogins(req: AuthRequest, res: Response): Promise } } +export async function listLockedAccounts(_req: AuthRequest, res: Response): Promise { + try { + const loginLockoutService = await import('../services/loginLockoutService'); + const items = await loginLockoutService.listTemporarilyLockedAccounts(); + res.json({ items, total: items.length }); + } catch (e) { + const msg = e instanceof Error ? e.message : 'Failed to list locked accounts'; + res.status(500).json({ error: msg }); + } +} + +export async function unlockAccount(req: AuthRequest, res: Response): Promise { + try { + const userId = req.params.userId; + if (!userId) { + res.status(400).json({ error: 'userId is required' }); + return; + } + const loginLockoutService = await import('../services/loginLockoutService'); + const { reason } = (req.body ?? {}) as { reason?: string }; + await loginLockoutService.adminUnlockAccount(userId, { + adminUserId: req.user!.userId, + ipAddress: req.ip || undefined, + userAgent: req.get('user-agent') || undefined, + reason, + }); + res.json({ ok: true }); + } catch (e) { + const msg = e instanceof Error ? e.message : 'Failed to unlock account'; + const status = msg === 'User not found' ? 404 : 500; + res.status(status).json({ error: msg }); + } +} + export async function exportAuditLogsCsv(req: AuthRequest, res: Response): Promise { try { const filters = req.query as unknown as AuditLogExportQuery; diff --git a/backend/src/repositories/userRepository.ts b/backend/src/repositories/userRepository.ts index 3ac9e7f0..e8fe478b 100644 --- a/backend/src/repositories/userRepository.ts +++ b/backend/src/repositories/userRepository.ts @@ -175,6 +175,31 @@ export async function getFailedLoginCount(userId: string): Promise { return rows[0]?.failed_login_count ?? 0; } +export type TemporarilyLockedUserRow = { + id: string; + email_encrypted: string | null; + phone_encrypted: string | null; + first_name: string | null; + last_name: string | null; + failed_login_count: number; + login_locked_until: Date; + updated_at: Date; +}; + +/** Users with an active or recently set temporary login lock. */ +export async function listTemporarilyLockedUsers(): Promise { + return query( + `SELECT id, email_encrypted, phone_encrypted, first_name, last_name, + failed_login_count, login_locked_until, updated_at + FROM users + WHERE deleted_at IS NULL + AND login_locked_until IS NOT NULL + AND login_locked_until > NOW() - INTERVAL '24 hours' + ORDER BY login_locked_until DESC + LIMIT 500` + ); +} + /** * Resolves a role ID to its display name. * @param roleId - Numeric role identifier. diff --git a/backend/src/routes/index.ts b/backend/src/routes/index.ts index 60477f09..eb0055d9 100644 --- a/backend/src/routes/index.ts +++ b/backend/src/routes/index.ts @@ -383,6 +383,18 @@ router.get( validateQuery(auditLogQuerySchema), securityController.listFailedLogins ); +router.get( + '/admin/security/locked-accounts', + requireRoles('admin'), + requirePermissions('security.admin'), + securityController.listLockedAccounts +); +router.post( + '/admin/security/locked-accounts/:userId/unlock', + requireRoles('admin'), + requirePermissions('security.admin'), + securityController.unlockAccount +); router.get( '/admin/security/audit-logs/export.csv', requireRoles('admin'), diff --git a/backend/src/services/authService.ts b/backend/src/services/authService.ts index 3889a06d..8feeb408 100644 --- a/backend/src/services/authService.ts +++ b/backend/src/services/authService.ts @@ -349,6 +349,7 @@ export async function login( userAgent: auditUa, reason: 'invalid_password', }); + await loginLockoutService.assertLoginNotLocked(user.id); throw new Error('Invalid credentials'); } @@ -370,6 +371,7 @@ export async function login( userAgent: auditUa, reason: 'invalid_2fa', }); + await loginLockoutService.assertLoginNotLocked(user.id); throw new Error('Invalid 2FA code'); } } diff --git a/backend/src/services/loginLockoutService.ts b/backend/src/services/loginLockoutService.ts index 499e237a..109bbbc4 100644 --- a/backend/src/services/loginLockoutService.ts +++ b/backend/src/services/loginLockoutService.ts @@ -4,17 +4,53 @@ import * as settingsRepository from '../repositories/settingsRepository'; import * as userRepository from '../repositories/userRepository'; +import { decrypt } from '../utils/crypto'; import { logSecurityEvent } from '../utils/securityAudit'; +export type AccountLockedError = Error & { + code: 'ACCOUNT_LOCKED'; + lockedUntil: string; + retryAfterMinutes: number; +}; + +function safeDecrypt(encrypted: string | null | undefined): string | null { + if (!encrypted) return null; + try { + return decrypt(encrypted); + } catch { + return null; + } +} + +export function minutesRemaining(lockedUntil: Date, now = Date.now()): number { + return Math.max(1, Math.ceil((lockedUntil.getTime() - now) / 60_000)); +} + +export function buildAccountLockedError(lockedUntil: Date): AccountLockedError { + const retryAfterMinutes = minutesRemaining(lockedUntil); + const err = new Error( + `Your account has been temporarily locked after several unsuccessful login attempts. You can try again in ${retryAfterMinutes} minute${retryAfterMinutes === 1 ? '' : 's'}.` + ) as AccountLockedError; + err.code = 'ACCOUNT_LOCKED'; + err.lockedUntil = lockedUntil.toISOString(); + err.retryAfterMinutes = retryAfterMinutes; + return err; +} + export async function assertLoginNotLocked(userId: string): Promise { const lockedUntil = await userRepository.getLoginLockedUntil(userId); - if (lockedUntil && lockedUntil.getTime() > Date.now()) { - const err = new Error('Account is temporarily locked due to too many failed login attempts') as Error & { - code?: string; - }; - err.code = 'ACCOUNT_LOCKED'; - throw err; + if (!lockedUntil) return; + + if (lockedUntil.getTime() > Date.now()) { + throw buildAccountLockedError(lockedUntil); } + + // Lock expired: clear state and audit automatic unlock. + await userRepository.resetFailedLoginState(userId); + logSecurityEvent('login_lockout_expired', { + userId, + metadata: { lockedUntil: lockedUntil.toISOString(), unlockedAt: new Date().toISOString() }, + }); } export async function recordFailedLogin( @@ -28,9 +64,22 @@ export async function recordFailedLogin( const count = await userRepository.incrementFailedLoginCount(userId); let lockedUntil: Date | null = null; - if (count >= maxAttempts && lockoutMinutes > 0) { + // maxAttempts <= 0 disables lockout by attempt count; lockoutMinutes <= 0 disables duration. + if (maxAttempts > 0 && lockoutMinutes > 0 && count >= maxAttempts) { lockedUntil = new Date(Date.now() + lockoutMinutes * 60 * 1000); await userRepository.setLoginLockedUntil(userId, lockedUntil); + logSecurityEvent('login_lockout_triggered', { + userId, + ipAddress: ctx.ipAddress ?? null, + userAgent: ctx.userAgent ?? null, + metadata: { + reason: ctx.reason, + failedCount: count, + maxAttempts, + lockoutMinutes, + lockedUntil: lockedUntil.toISOString(), + }, + }); } logSecurityEvent('login_failed', { @@ -48,3 +97,73 @@ export async function recordFailedLogin( export async function clearLoginFailures(userId: string): Promise { await userRepository.resetFailedLoginState(userId); } + +export async function adminUnlockAccount( + userId: string, + ctx: { adminUserId: string; ipAddress?: string; userAgent?: string; reason?: string } +): Promise { + const existing = await userRepository.findById(userId); + if (!existing) { + throw new Error('User not found'); + } + const lockedUntil = await userRepository.getLoginLockedUntil(userId); + const failedCount = await userRepository.getFailedLoginCount(userId); + + await userRepository.resetFailedLoginState(userId); + + logSecurityEvent('login_lockout_cleared', { + userId, + ipAddress: ctx.ipAddress ?? null, + userAgent: ctx.userAgent ?? null, + metadata: { + adminUserId: ctx.adminUserId, + reason: ctx.reason ?? 'admin_manual_unlock', + previousFailedCount: failedCount, + previousLockedUntil: lockedUntil?.toISOString() ?? null, + }, + }); +} + +export type LockedAccountRow = { + id: string; + email: string | null; + fullName: string | null; + phone: string | null; + failedLoginCount: number; + lockedUntil: string; + lockedAtApprox: string | null; + remainingMinutes: number; + status: 'locked' | 'expired'; +}; + +export async function listTemporarilyLockedAccounts(): Promise { + const settings = await settingsRepository.getSettings(); + const lockoutMinutes = settings.login_lockout_minutes; + const rows = await userRepository.listTemporarilyLockedUsers(); + const now = Date.now(); + + return rows.map((row) => { + const lockedUntil = new Date(row.login_locked_until); + const remaining = lockedUntil.getTime() - now; + const status: 'locked' | 'expired' = remaining > 0 ? 'locked' : 'expired'; + const fullName = [row.first_name, row.last_name].filter(Boolean).join(' ') || null; + const lockedAtApprox = + lockoutMinutes > 0 + ? new Date(lockedUntil.getTime() - lockoutMinutes * 60_000).toISOString() + : row.updated_at + ? new Date(row.updated_at).toISOString() + : null; + + return { + id: row.id, + email: safeDecrypt(row.email_encrypted), + fullName, + phone: safeDecrypt(row.phone_encrypted), + failedLoginCount: row.failed_login_count ?? 0, + lockedUntil: lockedUntil.toISOString(), + lockedAtApprox, + remainingMinutes: remaining > 0 ? minutesRemaining(lockedUntil, now) : 0, + status, + }; + }); +} diff --git a/prediqo_mobile/lib/core/errors/app_exception.dart b/prediqo_mobile/lib/core/errors/app_exception.dart index 3fcf6e2c..dddf0478 100644 --- a/prediqo_mobile/lib/core/errors/app_exception.dart +++ b/prediqo_mobile/lib/core/errors/app_exception.dart @@ -4,12 +4,19 @@ import '../../l10n/locale_controller.dart'; /// User-facing application error with optional HTTP status and API error code. class AppException implements Exception { - const AppException(this.message, {this.statusCode, this.code}); + const AppException( + this.message, { + this.statusCode, + this.code, + this.retryAfterMinutes, + }); final String message; final int? statusCode; /// Backend machine code when present (e.g. `EMAIL_NOT_VERIFIED`). final String? code; + /// Present for `ACCOUNT_LOCKED` responses. + final int? retryAfterMinutes; @override String toString() => message; @@ -24,6 +31,14 @@ class AppException implements Exception { return en; } + static String accountLockedMessage(int minutes) { + final m = minutes < 1 ? 1 : minutes; + return _t( + 'Your account has been temporarily locked after several unsuccessful login attempts. You can try again in $m minute${m == 1 ? '' : 's'}.', + 'Votre compte a été temporairement verrouillé après plusieurs tentatives de connexion infructueuses. Vous pourrez réessayer dans $m minute${m == 1 ? '' : 's'}.', + ); + } + /// Generic unreachable message — covers network issues, timeouts, DNS failures, /// and anything where we never got a meaningful server response. Blaming the /// connection is friendlier than "service unavailable" when the real cause is @@ -59,11 +74,22 @@ class AppException implements Exception { if (data is Map) { final msg = data['error'] ?? data['message']; final code = data['code']; + final retryRaw = data['retryAfterMinutes']; + final retryAfterMinutes = retryRaw is num ? retryRaw.toInt() : null; + if (code == 'ACCOUNT_LOCKED') { + return AppException( + accountLockedMessage(retryAfterMinutes ?? 1), + statusCode: status, + code: 'ACCOUNT_LOCKED', + retryAfterMinutes: retryAfterMinutes, + ); + } if (msg is String && msg.isNotEmpty) { return AppException( sanitizeApiMessage(msg, fallback: fallback), statusCode: status, code: code is String ? code : null, + retryAfterMinutes: retryAfterMinutes, ); } } diff --git a/prediqo_web/src/features/auth/LoginPage.tsx b/prediqo_web/src/features/auth/LoginPage.tsx index 0b3f5177..e21295cc 100644 --- a/prediqo_web/src/features/auth/LoginPage.tsx +++ b/prediqo_web/src/features/auth/LoginPage.tsx @@ -124,12 +124,20 @@ export function LoginPage() { nav(from, { replace: true }); } catch (e: any) { const code = e?.response?.data?.code; + const retryAfterMinutes = e?.response?.data?.retryAfterMinutes; const msg = code === 'CAPTCHA_REQUIRED' ? t('auth.captchaRequired') : code === 'CAPTCHA_INVALID' ? t('auth.captchaInvalid') - : apiErrorMessage(e, t('auth.loginFailed')); + : code === 'ACCOUNT_LOCKED' + ? t('auth.accountLocked', { + minutes: + typeof retryAfterMinutes === 'number' && retryAfterMinutes > 0 + ? retryAfterMinutes + : 1, + }) + : apiErrorMessage(e, t('auth.loginFailed')); setError(String(msg)); setEmailNotVerified(code === 'EMAIL_NOT_VERIFIED'); if (code === 'CAPTCHA_REQUIRED' || code === 'CAPTCHA_INVALID') { diff --git a/prediqo_web/src/features/security/SecurityAdminPage.tsx b/prediqo_web/src/features/security/SecurityAdminPage.tsx index 47895774..ec50c786 100644 --- a/prediqo_web/src/features/security/SecurityAdminPage.tsx +++ b/prediqo_web/src/features/security/SecurityAdminPage.tsx @@ -78,6 +78,18 @@ type AdminNotification = { createdAt: string; }; +type LockedAccount = { + id: string; + email: string | null; + fullName: string | null; + phone: string | null; + failedLoginCount: number; + lockedUntil: string; + lockedAtApprox: string | null; + remainingMinutes: number; + status: 'locked' | 'expired'; +}; + type LedgerCredit = { id: string; userId: string; @@ -358,6 +370,32 @@ export function SecurityAdminPage() { refetchInterval: tab === 4 && !wsConnected ? 10_000 : false, }); + const lockedAccountsQ = useQuery({ + queryKey: ['admin-locked-accounts'], + queryFn: async () => { + const res = await api.get<{ items: LockedAccount[]; total: number }>( + '/api/v1/admin/security/locked-accounts' + ); + return res.data; + }, + enabled: tab === 5, + refetchInterval: tab === 5 ? 15_000 : false, + }); + + const unlockAccountMut = useMutation({ + mutationFn: async (userId: string) => { + await api.post(`/api/v1/admin/security/locked-accounts/${userId}/unlock`, {}); + }, + onSuccess: () => { + void qc.invalidateQueries({ queryKey: ['admin-locked-accounts'] }); + void qc.invalidateQueries({ queryKey: ['admin-audit-logs'] }); + setResolveToast(t('admin.security.lockedAccounts.unlocked')); + }, + onError: () => { + setResolveToast(t('admin.security.lockedAccounts.unlockFailed')); + }, + }); + const walletTypesQ = useQuery({ queryKey: ['wallet-types'], queryFn: async () => { @@ -651,6 +689,11 @@ export function SecurityAdminPage() { + @@ -1069,6 +1112,119 @@ export function SecurityAdminPage() { )} {tab === 5 && ( + + + + + + {t('admin.security.lockedAccounts.title')} + + + {t('admin.security.lockedAccounts.subtitle')} + + + void lockedAccountsQ.refetch()} + loading={lockedAccountsQ.isFetching} + /> + + {lockedAccountsQ.isError && ( + + {t('admin.security.lockedAccounts.loadError')} + + )} + + + + + {t('admin.security.lockedAccounts.identity')} + {t('admin.security.lockedAccounts.email')} + {t('admin.security.lockedAccounts.failedAttempts')} + {t('admin.security.lockedAccounts.lockedAt')} + {t('admin.security.lockedAccounts.lockedUntil')} + {t('admin.security.lockedAccounts.remaining')} + {t('admin.security.lockedAccounts.status')} + + + + + {(lockedAccountsQ.data?.items ?? []).map((row) => ( + + + + {row.fullName || '—'} + + + {row.id.slice(0, 8)}… + + + + {row.email || '—'} + {row.phone && ( + + {row.phone} + + )} + + {row.failedLoginCount} + + {row.lockedAtApprox + ? new Date(row.lockedAtApprox).toLocaleString() + : '—'} + + {new Date(row.lockedUntil).toLocaleString()} + + {row.status === 'locked' + ? t('admin.security.lockedAccounts.minutes', { + count: row.remainingMinutes, + }) + : '—'} + + + + + + + + + ))} + {(lockedAccountsQ.data?.items ?? []).length === 0 && + !lockedAccountsQ.isLoading && ( + + + {t('admin.security.lockedAccounts.empty')} + + + )} + +
+
+
+
+ )} + + {tab === 6 && ( diff --git a/prediqo_web/src/features/settings/SettingsPage.tsx b/prediqo_web/src/features/settings/SettingsPage.tsx index 62ffaa6e..e45cd2bc 100644 --- a/prediqo_web/src/features/settings/SettingsPage.tsx +++ b/prediqo_web/src/features/settings/SettingsPage.tsx @@ -42,6 +42,9 @@ export function SettingsPage() { rate_limit_window_ms: number; rate_limit_max: number; login_rate_limit_max: number; + login_max_failed_attempts: number; + login_lockout_minutes: number; + login_captcha_after_failures: number; daily_withdrawal_limit_usd: number; large_withdrawal_threshold_usd: number; candle_predict_engine_tick_ms: number; @@ -401,6 +404,64 @@ export function SettingsPage() { + + }> + + + {t('admin.settings.sections.loginLockout.title')} + + + {t('admin.settings.sections.loginLockout.subtitle')} + + + + + + + set('login_max_failed_attempts', parseNum(e.target.value))} + fullWidth + slotProps={{ htmlInput: { min: 0, max: 50 } }} + /> + + + set('login_lockout_minutes', parseNum(e.target.value))} + fullWidth + slotProps={{ htmlInput: { min: 0, max: 1440 } }} + /> + + + + set('login_captcha_after_failures', parseNum(e.target.value)) + } + fullWidth + slotProps={{ htmlInput: { min: 0, max: 20 } }} + /> + + + + + }> diff --git a/prediqo_web/src/shared/i18n/locales/en.ts b/prediqo_web/src/shared/i18n/locales/en.ts index a825a974..2133c861 100644 --- a/prediqo_web/src/shared/i18n/locales/en.ts +++ b/prediqo_web/src/shared/i18n/locales/en.ts @@ -96,6 +96,8 @@ export const en = { enterEmailFirst: 'Enter your email address first.', emailPasswordRequired: 'Email and password are required.', loginFailed: 'Login failed', + accountLocked: + 'Your account has been temporarily locked after several unsuccessful login attempts. You can try again in {{minutes}} minute(s).', captchaRequired: 'Complete the security check below and try again.', captchaInvalid: 'Security check failed. Please try again.', resendFailed: 'Failed to resend verification email', @@ -1349,6 +1351,7 @@ export const en = { ledgerCredits: 'Ledger credits', dbAudit: 'DB audit ({{count}})', auditLog: 'Audit log ({{count}})', + lockedAccounts: 'Locked accounts ({{count}})', alertEmails: 'Alert emails', }, alerts: { @@ -1432,6 +1435,27 @@ export const en = { when: 'When', empty: 'No audit events recorded', }, + lockedAccounts: { + title: 'Temporarily locked accounts', + subtitle: + 'Accounts locked after too many failed login attempts. Unlock resets the failure counter immediately.', + loadError: 'Failed to load locked accounts.', + identity: 'Identity', + email: 'Email / phone', + failedAttempts: 'Failed attempts', + lockedAt: 'Locked at (approx.)', + lockedUntil: 'Locked until', + remaining: 'Time remaining', + status: 'Status', + statusLocked: 'Locked', + statusExpired: 'Expired', + unlock: 'Unlock', + unlocking: 'Unlocking…', + unlocked: 'Account unlocked.', + unlockFailed: 'Failed to unlock account.', + empty: 'No temporarily locked accounts', + minutes: '{{count}} min', + }, alertEmails: { title: 'Security alert emails', subtitle: 'One email per line. Encrypted at rest in the database.', @@ -1505,6 +1529,17 @@ export const en = { apiMax: 'API max requests / window', loginMax: 'Login max attempts / 15 min', }, + loginLockout: { + title: 'Account login lockout', + subtitle: + 'Temporarily lock accounts after repeated failed password or 2FA attempts. Takes effect immediately.', + maxAttempts: 'Max failed attempts before lock', + maxAttemptsHint: '0 = disable lockout by attempt count', + lockoutMinutes: 'Lockout duration (minutes)', + lockoutMinutesHint: '0 = disable temporary lockout (max 1440 = 24h)', + captchaAfter: 'Show captcha after N failures', + captchaAfterHint: 'Requires captcha to be configured on the server', + }, candlePredict: { title: 'Candle Predict engine', subtitle: 'Tick interval and backfill pacing (lower backfill = less DB load at scale).', diff --git a/prediqo_web/src/shared/i18n/locales/fr.ts b/prediqo_web/src/shared/i18n/locales/fr.ts index c55d1c98..5a1207f3 100644 --- a/prediqo_web/src/shared/i18n/locales/fr.ts +++ b/prediqo_web/src/shared/i18n/locales/fr.ts @@ -97,6 +97,8 @@ export const fr = { enterEmailFirst: 'Saisissez d’abord votre adresse e-mail.', emailPasswordRequired: 'L’e-mail et le mot de passe sont obligatoires.', loginFailed: 'Échec de la connexion', + accountLocked: + 'Votre compte a été temporairement verrouillé après plusieurs tentatives de connexion infructueuses. Vous pourrez réessayer dans {{minutes}} minute(s).', captchaRequired: 'Complétez la vérification de sécurité ci-dessous et réessayez.', captchaInvalid: 'Échec de la vérification de sécurité. Veuillez réessayer.', resendFailed: 'Échec de l’envoi de l’e-mail de vérification', @@ -1362,6 +1364,7 @@ export const fr = { ledgerCredits: 'Crédits grand livre', dbAudit: 'Audit DB ({{count}})', auditLog: 'Journal d’audit ({{count}})', + lockedAccounts: 'Comptes verrouillés ({{count}})', alertEmails: 'E-mails d’alerte', }, alerts: { @@ -1446,6 +1449,27 @@ export const fr = { when: 'Quand', empty: 'Aucun événement d’audit enregistré', }, + lockedAccounts: { + title: 'Comptes temporairement verrouillés', + subtitle: + 'Comptes verrouillés après trop de tentatives de connexion échouées. Le déverrouillage réinitialise immédiatement le compteur.', + loadError: 'Impossible de charger les comptes verrouillés.', + identity: 'Identité', + email: 'E-mail / téléphone', + failedAttempts: 'Tentatives échouées', + lockedAt: 'Verrouillé à (approx.)', + lockedUntil: 'Verrouillé jusqu’à', + remaining: 'Temps restant', + status: 'Statut', + statusLocked: 'Verrouillé', + statusExpired: 'Expiré', + unlock: 'Déverrouiller', + unlocking: 'Déverrouillage…', + unlocked: 'Compte déverrouillé.', + unlockFailed: 'Échec du déverrouillage.', + empty: 'Aucun compte temporairement verrouillé', + minutes: '{{count}} min', + }, alertEmails: { title: 'E-mails d’alerte sécurité', subtitle: 'Un e-mail par ligne. Chiffré au repos dans la base de données.', @@ -1519,6 +1543,17 @@ export const fr = { apiMax: 'Requêtes API max / fenêtre', loginMax: 'Tentatives de connexion max / 15 min', }, + loginLockout: { + title: 'Verrouillage temporaire des comptes', + subtitle: + 'Verrouille temporairement un compte après plusieurs échecs mot de passe ou 2FA. Prend effet immédiatement.', + maxAttempts: 'Tentatives échouées max avant verrouillage', + maxAttemptsHint: '0 = désactiver le verrouillage par nombre de tentatives', + lockoutMinutes: 'Durée du verrouillage (minutes)', + lockoutMinutesHint: '0 = désactiver (max 1440 = 24 h)', + captchaAfter: 'Afficher le captcha après N échecs', + captchaAfterHint: 'Nécessite un captcha configuré sur le serveur', + }, candlePredict: { title: 'Moteur Candle Predict', subtitle: 'Intervalle de tick et rythme de backfill (backfill plus bas = moins de charge DB à l’échelle).',