Merge branch 'master' into develop

This commit is contained in:
Barış Soner Uşaklı
2025-11-13 12:25:24 -05:00
4 changed files with 15 additions and 4 deletions

View File

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

View File

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

View File

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

View File

@@ -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}"`
);
});
});