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:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user