[mastodon-client] Add additional fields to /v1/apps response

This is undocumented under https://docs.joinmastodon.org/entities/Application/ but some apps expect it anyway.
This commit is contained in:
Laura Hausmann 2023-10-14 13:54:38 +02:00
parent c46ea29ba3
commit 7b951f76ed
No known key found for this signature in database
GPG key ID: D044E84C5BE01605
2 changed files with 6 additions and 2 deletions

View file

@ -4,8 +4,10 @@
**/ **/
namespace OAuth { namespace OAuth {
export type Application = { export type Application = {
id: string;
name: string; name: string;
website: string | null; website: string | null;
redirect_uri: string;
vapid_key: string | undefined; vapid_key: string | undefined;
client_id: string; client_id: string;
client_secret: string; client_secret: string;

View file

@ -37,11 +37,13 @@ export class AuthHelpers {
}).then((x) => OAuthApps.findOneByOrFail(x.identifiers[0])); }).then((x) => OAuthApps.findOneByOrFail(x.identifiers[0]));
return { return {
id: app.id,
name: app.name, name: app.name,
website: website, website: app.website,
redirect_uri: app.redirectUris.join('\n'),
client_id: app.clientId, client_id: app.clientId,
client_secret: app.clientSecret, client_secret: app.clientSecret,
vapid_key: await fetchMeta().then(meta => meta.swPublicKey ?? undefined), vapid_key: await fetchMeta().then(meta => meta.swPublicKey),
}; };
} }