mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-09 03:32:54 -05:00
🐛 Fix for returnUrl in OpenID auth (#4836)
* Fix for `returnUrl` in OpenID auth * md * change md number
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
6
upcoming-release-notes/4836.md
Normal file
6
upcoming-release-notes/4836.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Bugfix
|
||||
authors: [lelemm]
|
||||
---
|
||||
|
||||
Fix for returnUrl in OpenID auth
|
||||
Reference in New Issue
Block a user