Skip to content

Typings for validateScope don't correctly reflect that scope arg can be undefined #264

Closed
@dhensby

Description

@dhensby

Specify your setup

  • Operating System: MacOS
  • Node version: 18
  • npm version: 8
  • version of @node-oauth/oauth2-server: 5.0.0
  • which OAuth2 workflow: client_credentials
  • at which workflow step does the error occur: all

Describe the bug

Typings for validateScope don't correctly reflect that scope arg can be undefined

To Reproduce

Steps to reproduce the behavior:

  1. Receive an HTTP request with no scope parameter
  2. Note that scope parameter to model.validateScope() method is `undefined

Expected behavior

The typings correctly reflect that the scope argument is optional.

Screenshots

n/a

Additional context

The scope util that is responsible for parsing the scopes from a request (https://github.com/node-oauth/node-oauth2-server/blob/v5.0.0/lib/utils/scope-util.js#L10-L12) returns undefined when no scope parameter is present and this return value is then passed to the validateScope() method.

Metadata

Metadata

Assignees

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