[PR #4501] [MERGED] fix: revert set default iat for /token endpoint #5412

Closed
opened 2026-03-13 12:22:00 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/4501
Author: @dvanmali
Created: 9/7/2025
Status: Merged
Merged: 9/7/2025
Merged by: @Bekacru

Base: canaryHead: jwt-iat


📝 Commits (1)

  • 2634c4a fix: revert - provide iat for /token endpoint

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 packages/better-auth/src/plugins/jwt/sign.ts (+1 -0)

📄 Description

Revert, return missing iat claim from token endpoint.

iat itself is an optional claim, hense SHALL NOT be put in the signJWT function.

Addresses @erquhart comment on PR #4074


Summary by cubic

Restore the iat claim on JWTs returned by the /token endpoint by adding iat (UNIX seconds) to the payload in getJwtToken. Scope iat to this endpoint only, keeping the claim optional elsewhere and avoiding a default in signJWT.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/4501 **Author:** [@dvanmali](https://github.com/dvanmali) **Created:** 9/7/2025 **Status:** ✅ Merged **Merged:** 9/7/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `jwt-iat` --- ### 📝 Commits (1) - [`2634c4a`](https://github.com/better-auth/better-auth/commit/2634c4af9d89cf9b7c7692ad3fe29c18d658bcd8) fix: revert - provide iat for /token endpoint ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/jwt/sign.ts` (+1 -0) </details> ### 📄 Description Revert, return missing `iat` claim from token endpoint. `iat` itself is an optional claim, hense **SHALL NOT** be put in the `signJWT` function. Addresses @erquhart [comment](https://github.com/better-auth/better-auth/pull/4074#issuecomment-3263875308) on PR #4074 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Restore the iat claim on JWTs returned by the /token endpoint by adding iat (UNIX seconds) to the payload in getJwtToken. Scope iat to this endpoint only, keeping the claim optional elsewhere and avoiding a default in signJWT. <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-13 12:22:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#5412