mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-16 21:40:23 +01:00
Merge branch 'master' into develop
This commit is contained in:
@@ -120,8 +120,13 @@ ActivityPub.resolveInboxes = async (ids) => {
|
|||||||
|
|
||||||
if (!meta.config.activitypubAllowLoopback) {
|
if (!meta.config.activitypubAllowLoopback) {
|
||||||
ids = ids.filter((id) => {
|
ids = ids.filter((id) => {
|
||||||
|
try {
|
||||||
const { hostname } = new URL(id);
|
const { hostname } = new URL(id);
|
||||||
return hostname !== nconf.get('url_parsed').hostname;
|
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);
|
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);
|
return res.redirect(payload.next);
|
||||||
}
|
}
|
||||||
res.status(200).send(payload);
|
res.status(200).send(payload);
|
||||||
|
|||||||
@@ -53,6 +53,12 @@ module.exports = function (middleware) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (req.loggedIn) {
|
if (req.loggedIn) {
|
||||||
|
const exists = await user.exists(req.uid);
|
||||||
|
if (!exists) {
|
||||||
|
res.locals.logoutRedirect = true;
|
||||||
|
return controllers.authentication.logout(req, res);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else if (req.headers.hasOwnProperty('authorization')) {
|
} else if (req.headers.hasOwnProperty('authorization')) {
|
||||||
const user = await passportAuthenticateAsync(req, res);
|
const user = await passportAuthenticateAsync(req, res);
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ describe('i18n', () => {
|
|||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
sourceKeys.length,
|
sourceKeys.length,
|
||||||
translationKeys.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