Skip to content

A local-first personal finance app

Fix API init() silently ignoring authentication failures (#6337)

Matiss Janis Aboltins8734f7db22a7
diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts
index dc69f0d44b..e6ee4b7f25 100644
--- a/packages/loot-core/src/server/main.ts
+++ b/packages/loot-core/src/server/main.ts
@@ -259,9 +259,12 @@ export async function init(config: InitConfig) {
setServer(serverURL);
if (config.password) {
- await runHandler(handlers['subscribe-sign-in'], {
+ const result = await runHandler(handlers['subscribe-sign-in'], {
password: config.password,
});
+ if (result?.error) {
+ throw new Error(`Authentication failed: ${result.error}`);
+ }
}
} else {
// This turns off all server URLs. In this mode we don't want any
diff --git a/upcoming-release-notes/6337.md b/upcoming-release-notes/6337.md
new file mode 100644
index 0000000000..d297b729c2
--- /dev/null
+++ b/upcoming-release-notes/6337.md
@@ -0,0 +1,7 @@
+---
+category: Bugfix
+authors: [MatissJanis]
+---
+
+Fix API `downloadBudget` failing with "Could not get remote files" error when authentication fails silently during `init()`.
+