Skip to content

A local-first personal finance app

🐛 Fix for `returnUrl` in OpenID auth (#4836)

lelemma8d41e88a582
diff --git a/packages/loot-core/src/server/auth/app.ts b/packages/loot-core/src/server/auth/app.ts
index d42812eee2..07af2eb84e 100644
--- a/packages/loot-core/src/server/auth/app.ts
+++ b/packages/loot-core/src/server/auth/app.ts
@@ -248,7 +248,7 @@ async function signIn(
}
let res: {
token?: string;
- redirect_url?: string;
+ returnUrl?: string;
};
try {
@@ -267,8 +267,8 @@ async function signIn(
throw err;
}
- if (res.redirect_url) {
- return { redirectUrl: res.redirect_url };
+ if (res.returnUrl) {
+ return { redirectUrl: res.returnUrl };
}
if (!res.token) {
diff --git a/packages/sync-server/src/app-account.js b/packages/sync-server/src/app-account.js
index bd3a61cfcc..e1a9793de7 100644
--- a/packages/sync-server/src/app-account.js
+++ b/packages/sync-server/src/app-account.js
@@ -84,7 +84,7 @@ app.post('/login', async (req, res) => {
break;
}
case 'openid': {
- if (!isValidRedirectUrl(req.body.return_url)) {
+ if (!isValidRedirectUrl(req.body.returnUrl)) {
res
.status(400)
.send({ status: 'error', reason: 'Invalid redirect URL' });
@@ -92,14 +92,14 @@ app.post('/login', async (req, res) => {
}
const { error, url } = await loginWithOpenIdSetup(
- req.body.return_url,
+ req.body.returnUrl,
req.body.password,
);
if (error) {
res.status(400).send({ status: 'error', reason: error });
return;
}
- res.send({ status: 'ok', data: { redirect_url: url } });
+ res.send({ status: 'ok', data: { returnUrl: url } });
return;
}
diff --git a/upcoming-release-notes/4836.md b/upcoming-release-notes/4836.md
new file mode 100644
index 0000000000..642b9a4222
--- /dev/null
+++ b/upcoming-release-notes/4836.md
@@ -0,0 +1,6 @@
+---
+category: Bugfix
+authors: [lelemm]
+---
+
+Fix for returnUrl in OpenID auth