[mastodon-client] Fix verify_credentials occasionally showing outdated data

This commit is contained in:
Laura Hausmann 2023-10-05 21:13:25 +02:00
parent 01b5af2686
commit 5d17996d5f
No known key found for this signature in database
GPG Key ID: D044E84C5BE01605

View File

@ -192,7 +192,8 @@ export class UserHelpers {
}
public static async verifyCredentials(user: ILocalUser): Promise<MastodonEntity.Account> {
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 => {