-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Always ensure the newly created token expiry is not behind from exist… #1643
base: master
Are you sure you want to change the base?
Always ensure the newly created token expiry is not behind from exist… #1643
Conversation
can you add a test? |
e463e79
to
8aa3a3c
Compare
token: token.token_hash, | ||
expiry: token.expiry | ||
token: token.token_hash, | ||
expiry: [token.expiry, max_expiry + 1].max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why + 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max_expiry
is a timestamp and the expiry for the new token should be bigger than the current one and 1 is enough to achieve the goal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, can you add a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MaicolBen I tried to add but unfortunately cannot run test in my local. there is an instruction error in low level. How can I get help with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That isn't enough details, anyway if you get an idea on how write it, share it here and I can make it work.
Fix for #1618
It ensures that the new token's expiration date won't be erased during the creation process since in certain cases, the old tokens' expiration date may fall after the newly formed one.