[mastodon-client] Allow unauthorized uses to access /accounts/:id/statuses

This commit is contained in:
Laura Hausmann 2023-09-24 20:28:37 +02:00
parent f6d0183668
commit f8be4533df
No known key found for this signature in database
GPG key ID: D044E84C5BE01605

View file

@ -145,12 +145,7 @@ export function apiAccountMastodon(router: Router): void {
async (ctx) => { async (ctx) => {
try { try {
const auth = await authenticate(ctx.headers.authorization, null); const auth = await authenticate(ctx.headers.authorization, null);
const user = auth[0] ?? undefined; const user = auth[0] ?? null;
if (!user) {
ctx.status = 401;
return;
}
const userId = convertId(ctx.params.id, IdType.IceshrimpId); const userId = convertId(ctx.params.id, IdType.IceshrimpId);
const cache = UserHelpers.getFreshAccountCache(); const cache = UserHelpers.getFreshAccountCache();