merge: Add aliases to webfinger request. (!778)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/778

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: dakkar <dakkar@thenautilus.net>
This commit is contained in:
dakkar 2024-11-27 09:29:33 +00:00
commit 1ec5e846c5

View file

@ -140,6 +140,7 @@ fastify.get('/.well-known/change-password', async (request, reply) => {
}
const subject = `acct:${user.username}@${this.config.host}`;
const profileLink = `${this.config.url}/@${user.username}`;
const self = {
rel: 'self',
type: 'application/activity+json',
@ -148,7 +149,7 @@ fastify.get('/.well-known/change-password', async (request, reply) => {
const profilePage = {
rel: 'http://webfinger.net/rel/profile-page',
type: 'text/html',
href: `${this.config.url}/@${user.username}`,
href: profileLink,
};
const subscribe = {
rel: 'http://ostatus.org/schema/1.0/subscribe',
@ -164,12 +165,14 @@ fastify.get('/.well-known/change-password', async (request, reply) => {
{ element: 'Subject', value: subject },
{ element: 'Link', attributes: self },
{ element: 'Link', attributes: profilePage },
{ element: 'Link', attributes: subscribe });
{ element: 'Link', attributes: subscribe },
{ element: 'Alias', attributes: profileLink });
} else {
reply.type(jrd);
return {
subject,
links: [self, profilePage, subscribe],
aliases: [profileLink],
};
}
});