Skip to content

Mixing oauth2-server versions breaks instanceof Require #78

Open
@wallzero

Description

If using this project with latest oauth2-server, express-oauth-server will fail if using custom express middleware. For example:

      const req = new Request(request);
      const res = new Response(response);

      expressOAuthServer.server.token(req, res).then(() => {
          /* stuff */
      })

The above will throw this error.

This occurs if the parent project is using a newer version of oauth2-server than the one listed in express-oauth-server package.json. The instanceof fails I suppose due to newer class properties; though I haven't looked into it.

A workaround is to import Require and Response from node_modules/express-oauth-server/node_modules/oauth2-server. This will be fixed once the project is updated to use the latest oauth2-server.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions