Skip to content

[Documentation] revokeAuthorizationCode argument should be named code.authorizationCode, not code.code #216

Closed
@menewman

Description

@menewman

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

Snapshot of how it looks now:
Screenshot 2023-08-14 at 4 01 00 PM

There is one thing that is confusing about this, and one thing that I believe might be incorrect.

Confusing:

  • The code argument is described as The return value (I think this means it's identical to the value returned by getAuthorizationCode, but it is a bit confusing in the context of describing a function parameter)

Possibly incorrect:

  • The code.code argument does not match the return value of getAuthorizationCode, which would be code.authorizationCode instead.

Below, when a sample implementation snippet is provided, it actually uses authorizationCode and not code:
Screenshot 2023-08-14 at 4 07 51 PM

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentation 📑Improvements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions