Repository navigation
Show API token times in the admin's timezone - #570
Merged
Merged
Conversation
The expiry picker read the chosen time as UTC, so a time picked in local time could be refused as already past or saved hours off. The picker and the list's times now use the signed-in admin's profile timezone, times are still stored in UTC, and the expiry can't be set before now in that timezone.
21 tasks done
This was referenced Oct 17, 2026
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.
Fixes the expiry time on the API Tokens page (#569).
The problem
The expiry picker read the time you picked as UTC, the app's timezone. On development, picking 2:15 PM New York time at 2:00 PM was read as 14:15 UTC, four hours in the past, and was refused with "must be a date after now". A time that was accepted was saved four hours off, and the list showed every time in UTC.
The fix
after nowrule is replaced by a minimum of now in that timezone, so the browser's picker also blocks earlier times.Tested locally
tests/Feature/Admin/ApiTokenResourceTest.php: 9 passed. New cases, with the clock at 18:00 UTC and an admin inAmerica/New_York: 3:00 PM is accepted and saved as 19:00 UTC; 1:00 PM is refused; a token expiring at 19:00 UTC is listed as 15:00.To verify on development
See #567.