summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/mastodon/endpoints/apps.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/backend/src/server/api/mastodon/endpoints/apps.ts')
-rw-r--r--packages/backend/src/server/api/mastodon/endpoints/apps.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/backend/src/server/api/mastodon/endpoints/apps.ts b/packages/backend/src/server/api/mastodon/endpoints/apps.ts
index 5fce838f47..72b520c74a 100644
--- a/packages/backend/src/server/api/mastodon/endpoints/apps.ts
+++ b/packages/backend/src/server/api/mastodon/endpoints/apps.ts
@@ -5,6 +5,7 @@
import { Injectable } from '@nestjs/common';
import { MastodonClientService } from '@/server/api/mastodon/MastodonClientService.js';
+import { MastodonConverters } from '@/server/api/mastodon/MastodonConverters.js';
import type { FastifyInstance } from 'fastify';
const readScope = [
@@ -59,6 +60,7 @@ type AuthMastodonRoute = { Body?: AuthPayload, Querystring: AuthPayload };
export class ApiAppsMastodon {
constructor(
private readonly clientService: MastodonClientService,
+ private readonly mastoConverters: MastodonConverters,
) {}
public register(fastify: FastifyInstance): void {
@@ -108,6 +110,13 @@ export class ApiAppsMastodon {
return reply.send(response);
});
+
+ fastify.get('/v1/apps/verify_credentials', async (_request, reply) => {
+ const client = this.clientService.getClient(_request);
+ const data = await client.verifyAppCredentials();
+ const response = this.mastoConverters.convertApplication(data.data);
+ return reply.send(response);
+ });
}
}