-
-
Notifications
You must be signed in to change notification settings - Fork 54
Convert TokenModel to an ES6 class and extract utils function for calculating lifetime #223
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
Merged
jankapunkt
merged 1 commit into
node-oauth:development
from
menewman:fix-convert-token-model-to-es6
Aug 17, 2023
Merged
Convert TokenModel to an ES6 class and extract utils function for calculating lifetime #223
jankapunkt
merged 1 commit into
node-oauth:development
from
menewman:fix-convert-token-model-to-es6
Aug 17, 2023
+129
−42
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
...culating lifetime
jankapunkt
jankapunkt
approved these changes
Aug 17, 2023
12 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
You can’t perform that action at this time.
Summary
I saw open issue #212 for converting ES5-style classes to modern class syntax, and it seemed like a nice issue for new contributors to help chip away at (small refactoring that can be covered by unit tests; no functional changes).
So, I am submitting a PR to do that for the
TokenModelclass. Hopefully it is helpful! I'm happy to make changes to better match the desired styles/conventions of the repo as necessary. Or, if this PR isn't in line with what you had in mind, I won't be offended if you'd prefer to close it.Overview:
TokenModelto an ES6-style class (previously it was an ES5-style "constructor function").date-utilmodule.Linked issue(s)
One checkbox of #212 (but not the whole thing).
Involved parts of the project
Specifically the
TokenModel, which is used as a representation for access/refresh tokens.Added tests?
Although I did not make functional changes, I did add a couple of new test cases to make absolutely sure there weren't regressions.
token-model__test.jsto make sure that the model constructor is continuing to work as expected, especially when required arguments are missing, or when custom attributes are passed in.date-util__test.js) to specifically cover the extracted utility function.OAuth2 standard
N/A
Reproduction
N/A