From e5dc89c1cb8db47a44272e184f4162f7a385385a Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Sat, 14 Oct 2023 14:07:10 +0200 Subject: [PATCH] [mastodon-client] Fix type hints in AuthHelpers --- packages/backend/src/server/api/mastodon/helpers/auth.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/mastodon/helpers/auth.ts b/packages/backend/src/server/api/mastodon/helpers/auth.ts index 41f872728..1fba0f128 100644 --- a/packages/backend/src/server/api/mastodon/helpers/auth.ts +++ b/packages/backend/src/server/api/mastodon/helpers/auth.ts @@ -52,7 +52,7 @@ export class AuthHelpers { if (!user) throw new MastoApiError(401, "Unauthorized"); const body = ctx.request.body as any; - const scopes = (typeof body.scopes === "string" ? body.scopes.split(' ') : body.scopes) ?? ['read']; + const scopes: string[] = (typeof body.scopes === "string" ? body.scopes.split(' ') : body.scopes) ?? ['read']; const clientId = toSingleLast(body.client_id); if (clientId == null) throw new MastoApiError(400, "Invalid client_id"); @@ -94,7 +94,7 @@ export class AuthHelpers { public static async getAuthToken(ctx: MastoContext) { const body: any = ctx.request.body || ctx.request.query; - const scopes = (typeof body.scopes === "string" ? body.scopes.split(' ') : body.scopes) ?? ['read']; + const scopes: string[] = (typeof body.scopes === "string" ? body.scopes.split(' ') : body.scopes) ?? ['read']; const clientId = toSingleLast(body.client_id); const code = toSingleLast(body.code);