diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-03-30 02:15:51 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-03-30 02:15:51 -0400 |
| commit | 1bf6cdc17f9a5352c16eae2fb24a1829a09932b3 (patch) | |
| tree | 1df2e5dd35f4964e058fb9336a40e02d0e9c866e | |
| parent | Revert "revert 7bfada9792bc4d29d47d3895643543cbe15191cd: enhance: remove bull... (diff) | |
| download | sharkey-1bf6cdc17f9a5352c16eae2fb24a1829a09932b3.tar.gz sharkey-1bf6cdc17f9a5352c16eae2fb24a1829a09932b3.tar.bz2 sharkey-1bf6cdc17f9a5352c16eae2fb24a1829a09932b3.zip | |
restore login rate-limit checks
| -rw-r--r-- | packages/frontend/src/accounts.ts | 7 |
1 files changed, 7 insertions, 0 deletions
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', |