mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-15 21:10:22 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -120,8 +120,13 @@ ActivityPub.resolveInboxes = async (ids) => {
|
||||
|
||||
if (!meta.config.activitypubAllowLoopback) {
|
||||
ids = ids.filter((id) => {
|
||||
const { hostname } = new URL(id);
|
||||
return hostname !== nconf.get('url_parsed').hostname;
|
||||
try {
|
||||
const { hostname } = new URL(id);
|
||||
return hostname !== nconf.get('url_parsed').hostname;
|
||||
} catch (err) {
|
||||
winston.error(`[activitypub/resolveInboxes] Invalid id: ${id}`);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -490,7 +490,7 @@ authenticationController.logout = async function (req, res) {
|
||||
};
|
||||
await plugins.hooks.fire('filter:user.logout', payload);
|
||||
|
||||
if (req.body?.noscript === 'true') {
|
||||
if (req.body?.noscript === 'true' || res.locals.logoutRedirect === true) {
|
||||
return res.redirect(payload.next);
|
||||
}
|
||||
res.status(200).send(payload);
|
||||
|
||||
@@ -53,6 +53,12 @@ module.exports = function (middleware) {
|
||||
}
|
||||
|
||||
if (req.loggedIn) {
|
||||
const exists = await user.exists(req.uid);
|
||||
if (!exists) {
|
||||
res.locals.logoutRedirect = true;
|
||||
return controllers.authentication.logout(req, res);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else if (req.headers.hasOwnProperty('authorization')) {
|
||||
const user = await passportAuthenticateAsync(req, res);
|
||||
|
||||
@@ -163,7 +163,7 @@ describe('i18n', () => {
|
||||
assert.strictEqual(
|
||||
sourceKeys.length,
|
||||
translationKeys.length,
|
||||
`Extra keys found in namespace ${namespace.slice(1, -5)} for language "${language}"`
|
||||
`Extra keys found in namespace "${namespace.slice(1, -5)}" for language "${language}"`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user