ruby-jwt icon indicating copy to clipboard operation
ruby-jwt copied to clipboard

Fix Time.now casting causing false positive in verify_at

Open kevinreedy opened this issue 4 years ago • 2 comments
trafficstars

Fixes #353

kevinreedy avatar Dec 21 '20 05:12 kevinreedy

Hello, @kevinreedy! This is your first Pull Request that will be reviewed by SourceLevel, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

sourcelevel-bot[bot] avatar Dec 21 '20 05:12 sourcelevel-bot[bot]

Im wondering if the condition should be inclusive (>=) to handle cases where the verification happen on the same second the token has been issued.

Also a test verifying the "same-second" token would be good. Mocking the Time.now.to_i in a test could be a way to tackle the different cases.

anakinj avatar Dec 21 '20 14:12 anakinj