-
-
Notifications
You must be signed in to change notification settings - Fork 55
Description
Specify your setup
N/A -- purely a documentation issue
Describe the bug
View the documentation here:
https://node-oauthoauth2-server.readthedocs.io/en/latest/model/spec.html#revokeauthorizationcode-code
There is one thing that is confusing about this, and one thing that I believe might be incorrect.
Confusing:
- The
codeargument is described asThe return value(I think this means it's identical to the value returned bygetAuthorizationCode, but it is a bit confusing in the context of describing a function parameter)
Possibly incorrect:
- The
code.codeargument does not match the return value ofgetAuthorizationCode, which would becode.authorizationCodeinstead.
Below, when a sample implementation snippet is provided, it actually uses authorizationCode and not code:

Also, when I look at an example of a consumer of this library (@leaonline/oauth2-server), I see that in fact the field used does appear to be named authorizationCode, not code:
https://github.com/leaonline/oauth2-server/blob/master/lib/model/meteor-model.js#L118
So I believe it is just a typo in the docs.
Expected behavior
Ideally, the docs should be updated for clarity.
The description for the code argument overall could be updated to something like "The code to be revoked," mirroring the description for saveAuthorizationCode.
And the code.code field could be renamed in the docs to code.authorizationCode.
Additional context
I'd be happy to submit a small documentation fix PR if maintainers agree that what I'm suggesting makes sense. :)
Just sending an issue first to comply with the "No PR without issue" rule in the Contributing guidelines:
https://github.com/node-oauth/node-oauth2-server/blob/074e3921edb41763999df4ad1c95e9c029675318/CONTRIBUTING.md#no-pr-without-issue
