[PR #6337] Fix API init() silently ignoring authentication failures #20814

Closed
opened 2026-04-14 21:45:47 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6337

State: closed
Merged: Yes


Summary

When using the @actual-app/api package, if authentication failed during init() (e.g., wrong password, network issue), the error was silently ignored. This led to confusing "Could not get remote files" errors later when calling downloadBudget().

Changes

  • Modified init() in packages/loot-core/src/server/main.ts to check the result of the sign-in handler and throw an error if authentication fails

Before

await actual.init({
  serverURL: 'https://example.com',
  password: 'wrong-password',
});
// No error thrown, init() appears to succeed

await actual.downloadBudget('sync-id');
// Error: Could not get remote files (confusing!)

After

await actual.init({
  serverURL: 'https://example.com', 
  password: 'wrong-password',
});
// Error: Authentication failed: invalid-password (clear feedback!)

Maybe fixes #6320

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6337 **State:** closed **Merged:** Yes --- ## Summary When using the `@actual-app/api` package, if authentication failed during `init()` (e.g., wrong password, network issue), the error was silently ignored. This led to confusing "Could not get remote files" errors later when calling `downloadBudget()`. ## Changes - Modified `init()` in `packages/loot-core/src/server/main.ts` to check the result of the sign-in handler and throw an error if authentication fails ## Before ```javascript await actual.init({ serverURL: 'https://example.com', password: 'wrong-password', }); // No error thrown, init() appears to succeed await actual.downloadBudget('sync-id'); // Error: Could not get remote files (confusing!) ``` ## After ```javascript await actual.init({ serverURL: 'https://example.com', password: 'wrong-password', }); // Error: Authentication failed: invalid-password (clear feedback!) ``` Maybe fixes #6320
GiteaMirror added the pull-request label 2026-04-14 21:45:47 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#20814