Skip to content

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

Closed
javaharut wants to merge 1 commit into
lynndylanhurley:masterfrom
javaharut:fix_user_signin_issue_on_device_limit
Closed

Always ensure the newly created token expiry is not behind from exist…#1643
javaharut wants to merge 1 commit into
lynndylanhurley:masterfrom
javaharut:fix_user_signin_issue_on_device_limit

Conversation

@javaharut

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@MaicolBen

Copy link
Copy Markdown
Collaborator

I believe #1657 fixed the same issue, let me know otherwise

@MaicolBen MaicolBen closed this Jul 13, 2025
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