Skip to content

fix: tokenRenewal seems to be hard coded #1540 #2042

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
merged 2 commits into from
Jun 18, 2020
Merged

Conversation

regevbr
Copy link
Contributor

@regevbr regevbr commented Jun 10, 2020

fix: #1540

@regevbr regevbr changed the title fix: tokenRenewal seems to be hard coded #154 fix: tokenRenewal seems to be hard coded #1540 Jun 10, 2020
@auto-assign auto-assign bot requested a review from NGPixel June 10, 2020 17:54

Verified

This commit was signed with the committer’s verified signature.
regevbr Regev Brody
@regevbr
Copy link
Contributor Author

regevbr commented Jun 11, 2020

@NGPixel can you please CR? Super short fix...

1 similar comment
@regevbr
Copy link
Contributor Author

regevbr commented Jun 16, 2020

@NGPixel can you please CR? Super short fix...

@@ -112,7 +113,8 @@ module.exports = {
if (err) { return next() }

// Expired but still valid within N days, just renew
if (info instanceof Error && info.name === 'TokenExpiredError' && moment().subtract(14, 'days').isBefore(info.expiredAt)) {
if (info instanceof Error && info.name === 'TokenExpiredError' &&
moment.subtract(ms(WIKI.config.auth.tokenRenewal), 'ms').isBefore(info.expiredAt)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be moment(), otherwise you're relying on an existing instance which could have been modified previously.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops my bad

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NGPixel fixed, please review

Verified

This commit was signed with the committer’s verified signature.
regevbr Regev Brody
@NGPixel NGPixel merged commit 0e6340f into requarks:master Jun 18, 2020
@regevbr regevbr deleted the #1540 branch June 18, 2020 19:37
jionggyu pushed a commit to jionggyu/wiki-2.5.302-patch that referenced this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tokenRenewal seems to be hard coded
2 participants