Skip to content
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

fix: update typing for validateScope making scope an optional parameter #265

Merged
merged 2 commits into from
Nov 18, 2023

Conversation

dhensby
Copy link
Contributor

@dhensby dhensby commented Nov 14, 2023

Summary

If a request is received with no scope in the request body, then the scope argument to validateScope is undefined instead of an array. This change updates the typings to be consistent with that behaviour.

Linked issue(s)

resolves #264

Involved parts of the project

https://github.com/node-oauth/node-oauth2-server/blob/v5.0.0/lib/utils/scope-util.js#L10-L12

Added tests?

n/a

OAuth2 standard

n/a

Reproduction

See issue.

jankapunkt and others added 2 commits November 7, 2023 10:49
If a request is received with no scope in the request body, then the `scope`
argument to `validateScope` is undefined instead of an array.
This change updates the typings to be consistent with that behaviour.
@jankapunkt jankapunkt changed the base branch from master to development November 18, 2023 08:40
@jankapunkt jankapunkt merged commit e01a5e4 into node-oauth:development Nov 18, 2023
4 checks passed
@dhensby dhensby deleted the pulls/types branch November 18, 2023 09:25
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 this pull request may close these issues.

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