fix: lockout countdown shows NaN minutes
Unit Tests / test (push) Successful in 7m31s

The API returns locked_until already ending in 'Z' (UTC ISO format).
Appending another 'Z' produces an invalid date string, so Date arithmetic
yielded NaN. Remove the redundant suffix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-07 16:28:14 -04:00
parent 1607a2e86f
commit 962d137093
+1 -1
View File
@@ -23,7 +23,7 @@ export default function Login() {
if (err.response?.status === 423) {
const lockedUntil = err.response?.data?.locked_until;
if (lockedUntil) {
const mins = Math.ceil((new Date(lockedUntil + 'Z') - Date.now()) / 60000);
const mins = Math.ceil((new Date(lockedUntil) - Date.now()) / 60000);
setError(`Account locked. Try again in ${mins} minute${mins !== 1 ? 's' : ''}.`);
} else {
setError('Account locked. Too many failed attempts. Try again later.');