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

[update-chance-access-token] Update chance-access-token library to v2 #287

Merged
merged 2 commits into from
Jan 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Next
### Maintainance
* Update chance-access-token library to v2

## 3.1.0
### New features
* [#277](https://github.com/lelylan/simple-oauth2/pull/277) Add support to parse expire at property on access tokens as UNIX timestamps
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@hapi/boom": "^8.0.1",
"ava": "^2.4.0",
"chance": "^1.1.0",
"chance-access-token": "^1.0.1",
"chance-access-token": "^2.0.0",
"doctoc": "^1.4.0",
"eslint": "^6.5.1",
"eslint-config-airbnb-base": "^14.0.0",
Expand Down
8 changes: 3 additions & 5 deletions test/access_token.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('@create => do not reassigns the expires at property when is already a date

const accessTokenResponse = chance.accessToken({
expired: true,
parseDate: true,
dateFormat: 'date',
expireMode: 'expires_at',
});

Expand All @@ -56,11 +56,9 @@ test('@create => parses the expires at property when is UNIX timestamp in second

const accessTokenResponse = chance.accessToken({
expired: true,
parseDate: false,
dateFormat: 'unix',
expireMode: 'expires_at',
});
// Sometimes expires_at is also given as a UNIX timestamp in seconds:
accessTokenResponse.expires_at = Math.round(new Date(accessTokenResponse.expires_at).getTime() / 1000);

const accessToken = oauth2.accessToken.create(accessTokenResponse);

Expand All @@ -74,7 +72,7 @@ test('@create => parses the expires at property when is ISO time', (t) => {

const accessTokenResponse = chance.accessToken({
expired: true,
parseDate: false,
dateFormat: 'iso',
expireMode: 'expires_at',
});

Expand Down