From 1bf6cdc17f9a5352c16eae2fb24a1829a09932b3 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sun, 30 Mar 2025 02:15:51 -0400 Subject: [PATCH] restore login rate-limit checks --- packages/frontend/src/accounts.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/frontend/src/accounts.ts b/packages/frontend/src/accounts.ts index a25f3c51d1..f4cff74a97 100644 --- a/packages/frontend/src/accounts.ts +++ b/packages/frontend/src/accounts.ts @@ -95,6 +95,13 @@ function fetchAccount(token: string, id?: string, forceShowDialog?: boolean): Pr text: i18n.ts.tokenRevokedDescription, }); } + } else if (res.error.id === 'd5826d14-3982-4d2e-8011-b9e9f02499ef') { + // rate limited + const timeToWait = res.error.info?.resetMs ?? 1000; + window.setTimeout(() => { + fetchAccount(token, id, forceShowDialog).then(done, fail); + }, timeToWait); + return; } else { await alert({ type: 'error',