You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to trigger an UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: Invalid 'grant_type' type warning for invalid requests in version 4.0.0 and later.
Steps to Reproduce
Start the following server in 4.0.0 or 4.1.0:
const { OAuth2Server } = require('oauth2-mock-server');
async function startServer() {
let server = new OAuth2Server();
await server.issuer.keys.generate('RS256');
await server.start(8080, 'localhost');
}
startServer();
Run curl --request POST --url http://localhost:8080/token --header 'Content-Type: multipart/form-data;'
Expected Behavior
An assertion failure message. The equivalent code in version 3.2.0 works as expected:
const { OAuth2Server } = require('oauth2-mock-server');
async function startServer() {
let server = new OAuth2Server();
await server.issuer.keys.generateRSA();
await server.start(8080, 'localhost');
}
startServer();
Environment
oauth2-mock-server version: 4.1.0
Noje.JS version: 14.15.0
NPM version: 6.14.8
Operating System: macOS 11.6
The text was updated successfully, but these errors were encountered:
Summary
It is possible to trigger an
UnhandledPromiseRejectionWarning: AssertionError [ERR_ASSERTION]: Invalid 'grant_type' type
warning for invalid requests in version 4.0.0 and later.Steps to Reproduce
curl --request POST --url http://localhost:8080/token --header 'Content-Type: multipart/form-data;'
Expected Behavior
An assertion failure message. The equivalent code in version 3.2.0 works as expected:
Environment
oauth2-mock-server
version: 4.1.0The text was updated successfully, but these errors were encountered: