fix(simplefin): add 30s AbortSignal timeout to fetch calls

This commit is contained in:
null 2026-06-06 14:54:00 -05:00
parent 6168a71d8f
commit a66fe13bc6
1 changed files with 2 additions and 1 deletions

View File

@ -64,7 +64,7 @@ async function claimSetupToken(setupToken) {
let accessUrl;
try {
const res = await fetch(claimUrl, { method: 'POST' });
const res = await fetch(claimUrl, { method: 'POST', signal: AbortSignal.timeout(30000) });
if (res.status === 403) {
throw new Error('This setup token has already been claimed or is invalid');
}
@ -99,6 +99,7 @@ async function fetchAccountsAndTransactions(accessUrl, sinceEpoch) {
try {
const res = await fetch(endpoint, {
headers: { 'Authorization': `Basic ${basicAuth}` },
signal: AbortSignal.timeout(30000),
});
if (res.status === 403) {
throw Object.assign(new Error('SimpleFIN access has been revoked — please reconnect'), { code: 'SIMPLEFIN_REVOKED' });