Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dhensby opened this issue Nov 14, 2023 · 0 comments · Fixed by #265
Closed

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

dhensby opened this issue Nov 14, 2023 · 0 comments · Fixed by #265
Assignees

Comments

@dhensby
Copy link
Contributor

dhensby commented Nov 14, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant