node-oauth / node-oauth2-server

🚀 The successor to oauthjs/oauth2-server. 🔒 Complete, compliant, maintained and well tested OAuth2 Server for node.js. Includes native async await and PKCE.
https://www.npmjs.com/package/@node-oauth/oauth2-server
MIT License
286 stars 39 forks source link

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

Closed dhensby closed 10 months ago

dhensby commented 10 months ago

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.