mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
[mastodon-client] Fix type hints in AuthHelpers
This commit is contained in:
parent
7b951f76ed
commit
e5dc89c1cb
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue