From 5d17996d5fa3593ee32d0031f15def198dde9685 Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Thu, 5 Oct 2023 21:13:25 +0200 Subject: [PATCH] [mastodon-client] Fix verify_credentials occasionally showing outdated data --- packages/backend/src/server/api/mastodon/helpers/user.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/mastodon/helpers/user.ts b/packages/backend/src/server/api/mastodon/helpers/user.ts index 1eb88a161..25150a540 100644 --- a/packages/backend/src/server/api/mastodon/helpers/user.ts +++ b/packages/backend/src/server/api/mastodon/helpers/user.ts @@ -192,7 +192,8 @@ export class UserHelpers { } public static async verifyCredentials(user: ILocalUser): Promise { - const acct = UserConverter.encode(user); + // re-fetch local user because auth user possibly contains outdated info + const acct = getUser(user.id).then(u => UserConverter.encode(u)); const profile = UserProfiles.findOneByOrFail({userId: user.id}); const privacy = this.getDefaultNoteVisibility(user); const fields = profile.then(profile => profile.fields.map(field => {