Fix expiration date comparison to use date-only logic#76
Merged
Conversation
…tion day The check compared a midnight-only datetime against the current time, so any EXPIRATION_DATE set to today would be considered expired after midnight UTC. Now compares dates only, so authorization is valid through the end of the day. https://claude.ai/code/session_01EEAgU9vmCAvuVvm6Y2grTq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixed a bug in the expiration date validation logic where datetime objects with timezone information were being compared to date objects, which could cause unexpected behavior or errors.
Key Changes
exp_datefrom a timezone-aware datetime object to a date object by calling.date()on the parsed datetimedatetime.now(UTC)todatetime.now(UTC).date()to ensure we're comparing date-to-date instead of datetime-to-dateImplementation Details
The fix ensures that expiration date comparisons are performed at the date level rather than mixing datetime and date types. Since the
EXPIRATION_DATEformat only includes the date (YYYY-MM-DD), comparing against today's date is more semantically correct and avoids potential timezone-related edge cases.https://claude.ai/code/session_01EEAgU9vmCAvuVvm6Y2grTq