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

Always ensure the newly created token expiry is not behind from exist… #1643

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

javaharut
Copy link

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.

@MaicolBen
Copy link
Collaborator

can you add a test?

@javaharut javaharut force-pushed the fix_user_signin_issue_on_device_limit branch from e463e79 to 8aa3a3c Compare January 6, 2025 19:34
token: token.token_hash,
expiry: token.expiry
token: token.token_hash,
expiry: [token.expiry, max_expiry + 1].max
Copy link
Collaborator

Choose a reason for hiding this comment

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

why + 1 ?

Copy link
Author

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

Copy link
Collaborator

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?

Copy link
Author

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?

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants