[PR #7937] [MERGED] fix: safely coerce date values from DB in OAuth provider plugin #7638

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7937
Author: @himself65
Created: 2/12/2026
Status: Merged
Merged: 2/12/2026
Merged by: @himself65

Base: canaryHead: himself65/2026/02/12/fix-type


📝 Commits (1)

  • d3bb991 fix: safely coerce date values from DB in OAuth provider plugin

📊 Changes

2 files changed (+6 additions, -6 deletions)

View changed files

📝 packages/oauth-provider/src/introspect.ts (+4 -4)
📝 packages/oauth-provider/src/register.ts (+2 -2)

📄 Description

Fixes: https://github.com/better-auth/better-auth/pull/7885


Summary by cubic

Safely coerce DB date fields to Date in the OAuth provider so JWT exp/iat and client timestamps are computed correctly. Prevents crashes and wrong timestamps when DB drivers return strings.

  • Bug Fixes
    • Wrap expiresAt/createdAt with new Date(...) before getTime() in token introspection and client registration.
    • Ensures consistent token introspection and registration across different DB drivers/ORMs.

Written for commit d3bb991166. Summary will update on new commits.


🔄 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/7937 **Author:** [@himself65](https://github.com/himself65) **Created:** 2/12/2026 **Status:** ✅ Merged **Merged:** 2/12/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2026/02/12/fix-type` --- ### 📝 Commits (1) - [`d3bb991`](https://github.com/better-auth/better-auth/commit/d3bb991166f9a86e70ec705f05cab3c9ef4dabd3) fix: safely coerce date values from DB in OAuth provider plugin ### 📊 Changes **2 files changed** (+6 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `packages/oauth-provider/src/introspect.ts` (+4 -4) 📝 `packages/oauth-provider/src/register.ts` (+2 -2) </details> ### 📄 Description Fixes: https://github.com/better-auth/better-auth/pull/7885 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Safely coerce DB date fields to Date in the OAuth provider so JWT exp/iat and client timestamps are computed correctly. Prevents crashes and wrong timestamps when DB drivers return strings. - **Bug Fixes** - Wrap expiresAt/createdAt with new Date(...) before getTime() in token introspection and client registration. - Ensures consistent token introspection and registration across different DB drivers/ORMs. <sup>Written for commit d3bb991166f9a86e70ec705f05cab3c9ef4dabd3. Summary will update on new commits.</sup> <!-- 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 13:44: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#7638