🐛 Fix for returnUrl in OpenID auth (#4836)

* Fix for `returnUrl` in OpenID auth

* md

* change md number
This commit is contained in:
lelemm
2025-04-17 13:03:21 -03:00
committed by GitHub
parent 62ab6a12e8
commit a8d41e88a5
3 changed files with 12 additions and 6 deletions

View File

@@ -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) {

View File

@@ -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;
}

View File

@@ -0,0 +1,6 @@
---
category: Bugfix
authors: [lelemm]
---
Fix for returnUrl in OpenID auth