fix: add headers for NC integration

This commit is contained in:
2025-10-01 14:53:34 +02:00
parent da0e3108ca
commit fcc2a9a003
+5 -5
View File
@@ -467,12 +467,12 @@ app.get('/', async function (req, res) {
}
console.log("IsValidJWT: ", IsValidJWT(username, password));
if (validRedmineUser && (validRedmineAuth || IsValidOldSecret(username, password) || IsValidJWT(username, password))) {
res.status(200).json(userProfile);
res.set({"WWW-Authenticate": "Basic " + username}).status(200).json(userProfile);
} else {
res.status(401).json(null);
res.set({"WWW-Authenticate": "Basic " + username}).status(401).json(null);
}
} else {
res.status(401).json(null);
res.set({"WWW-Authenticate": "Basic " + username}).status(401).json(null);
}
} else {
@@ -586,9 +586,9 @@ app.get('/login2fa', async function (req, res) {
}
console.log("IsValidJWT: ", IsValidJWT(username, password));
if (validRedmineUser && (validRedmineAuth || IsValidOldSecret(username, password) || IsValidJWT(username, password))) {
res.status(200).json(userProfile);
res.set({"WWW-Authenticate": "Basic " + username}).status(200).json(userProfile);
} else {
res.status(401).json(null);
res.set({"WWW-Authenticate": "Basic " + username}).status(401).json(null);
}
} else {
res.status(401).json(null);