diff --git a/packages/backend/src/server/api/ApiCallService.ts b/packages/backend/src/server/api/ApiCallService.ts index c6c33f73032933fff46ae3b8fcdd7ada585d1a15..03f25a51fe970bed6e854619cdf4e50c3a438bf0 100644 --- a/packages/backend/src/server/api/ApiCallService.ts +++ b/packages/backend/src/server/api/ApiCallService.ts @@ -340,7 +340,7 @@ export class ApiCallService implements OnApplicationShutdown { code: 'RATE_LIMIT_EXCEEDED', id: 'd5826d14-3982-4d2e-8011-b9e9f02499ef', httpStatusCode: 429, - }); + }, info); } } } diff --git a/packages/frontend/src/account.ts b/packages/frontend/src/account.ts index e3416f2c296f2042f9fea67d429cc79a409fbfe6..f0a464084f56b92956b829d92851f213f5908855 100644 --- a/packages/frontend/src/account.ts +++ b/packages/frontend/src/account.ts @@ -147,6 +147,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(timeToWait, () => { + fetchAccount(token, id, forceShowDialog).then(done, fail); + }); + return; } else { await alert({ type: 'error',