You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🪲 [Fix]: Fix an issue with all App/JWT tokens being marked as expired (#497)
## Description
This pull request updates the handling of JWT token issue and expiry
times, ensuring consistent use of local time and simplifying the
calculation of token expiry intervals. The changes improve time zone
handling and streamline the logic for determining token validity.
**Improvements to JWT Time Handling:**
* Changed the calculation of `IssuedAt` and `ExpiresAt` in
`New-GitHubUnsignedJWT.ps1` to use `LocalDateTime` instead of
`DateTime`, ensuring the times are always in local time.
* In `Update-GitHubAppJWT.ps1`, added logic to convert `ExpiresAt` from
UTC to local time if needed before updating the context, further
standardizing time zone usage.
**Simplification of Token Expiry Calculation:**
* Simplified the `TokenExpiresIn` and `RefreshTokenExpiresIn` script
properties in `GitHubContext.Types.ps1xml` by removing redundant checks
for negative intervals and directly returning the time difference.
## Type of change
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [ ] 📖 [Docs]
- [x] 🪲 [Fix]
- [ ] 🩹 [Patch]
- [ ] ⚠️ [Security fix]
- [ ] 🚀 [Feature]
- [ ] 🌟 [Breaking change]
## Checklist
<!-- Use the check-boxes [x] on the options that are relevant. -->
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
0 commit comments