From 82c9820ac89f0f81d3e8eee88756d719bac42843 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 2 Apr 2023 13:20:41 +0200 Subject: [PATCH] tmp --- packages/backend/src/server/oauth/OAuth2ProviderService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/server/oauth/OAuth2ProviderService.ts b/packages/backend/src/server/oauth/OAuth2ProviderService.ts index afd06721a..4a4080295 100644 --- a/packages/backend/src/server/oauth/OAuth2ProviderService.ts +++ b/packages/backend/src/server/oauth/OAuth2ProviderService.ts @@ -361,7 +361,7 @@ export class OAuth2ProviderService { return [code]; })().then(args => done(null, ...args), err => done(err)); })); - this.#server.exchange(oauth2orize.exchange.code((client, code, redirectUri, body, done) => { + this.#server.exchange(oauth2orize.exchange.authorizationCode((client, code, redirectUri, body, done) => { (async (): Promise>> => { const granted = TEMP_GRANT_CODES[code]; console.log(granted, body, code, redirectUri); @@ -495,6 +495,8 @@ export class OAuth2ProviderService { done(null, undefined); })); + // Clients may use JSON or urlencoded + fastify.use('/oauth/token', bodyParser.urlencoded({ extended: false })); fastify.use('/oauth/token', bodyParser.json({ strict: true })); fastify.use('/oauth/token', this.#server.token()); // }