From 852b5373bc5464f1cb04d977169f892e314507ea Mon Sep 17 00:00:00 2001 From: Matiss Janis Aboltins Date: Thu, 7 Sep 2023 17:40:58 +0100 Subject: [PATCH] :bug: (signup) fix setting up for the first time with missing protocol (#1657) --- .../src/components/manager/ConfigServer.tsx | 2 +- packages/loot-core/src/server/main.ts | 8 ++++++-- packages/loot-core/src/server/server-config.ts | 3 +-- upcoming-release-notes/1657.md | 6 ++++++ 4 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 upcoming-release-notes/1657.md diff --git a/packages/desktop-client/src/components/manager/ConfigServer.tsx b/packages/desktop-client/src/components/manager/ConfigServer.tsx index 8934024d207..e61887a8e21 100644 --- a/packages/desktop-client/src/components/manager/ConfigServer.tsx +++ b/packages/desktop-client/src/components/manager/ConfigServer.tsx @@ -49,7 +49,7 @@ export default function ConfigServer() { let { error } = await setServerUrl(url); if ( - error === 'network-failure' && + ['network-failure', 'get-server-failure'].includes(error) && !url.startsWith('http://') && !url.startsWith('https://') ) { diff --git a/packages/loot-core/src/server/main.ts b/packages/loot-core/src/server/main.ts index d76af67ee11..ac739846511 100644 --- a/packages/loot-core/src/server/main.ts +++ b/packages/loot-core/src/server/main.ts @@ -1628,8 +1628,12 @@ handlers['get-did-bootstrap'] = async function () { handlers['subscribe-needs-bootstrap'] = async function ({ url, }: { url? } = {}) { - if (!getServer(url)) { - return { bootstrapped: true, hasServer: false }; + try { + if (!getServer(url)) { + return { bootstrapped: true, hasServer: false }; + } + } catch (err) { + return { error: 'get-server-failure' }; } let res; diff --git a/packages/loot-core/src/server/server-config.ts b/packages/loot-core/src/server/server-config.ts index 623cced37c4..ab0e72096dc 100644 --- a/packages/loot-core/src/server/server-config.ts +++ b/packages/loot-core/src/server/server-config.ts @@ -32,8 +32,7 @@ export function getServer(url?: string): ServerConfig | null { SYNC_SERVER: joinURL(url, '/sync'), SIGNUP_SERVER: joinURL(url, '/account'), PLAID_SERVER: joinURL(url, '/plaid'), - // TODO: change to use `/gocardless` after v23.8.0 - GOCARDLESS_SERVER: joinURL(url, '/nordigen'), + GOCARDLESS_SERVER: joinURL(url, '/gocardless'), }; } return config; diff --git a/upcoming-release-notes/1657.md b/upcoming-release-notes/1657.md new file mode 100644 index 00000000000..50be64716e1 --- /dev/null +++ b/upcoming-release-notes/1657.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MatissJanis] +--- + +Fix signup page not allowing to use domains without protocol