This commit is contained in:
Kagami Sascha Rosylight 2023-04-02 13:20:41 +02:00
parent 39526d0225
commit 82c9820ac8
1 changed files with 3 additions and 1 deletions

View File

@ -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<OmitFirstElement<Parameters<typeof done>>> => {
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());
// }