[PR #1563] [MERGED] fix: oauth failing when using drizzle adapter #29465

Closed
opened 2026-04-17 20:47:48 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/1563
Author: @focux
Created: 2/24/2025
Status: Merged
Merged: 2/24/2025
Merged by: @Bekacru

Base: v1.2Head: v1.2


📝 Commits (1)

  • 616363a fix: oauth failing when using drizzle adapter

📊 Changes

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

View changed files

📝 packages/better-auth/src/db/internal-adapter.ts (+1 -1)

📄 Description

This PR addresses an issue with the Drizzle adapter where OAuth providers were failing due to incorrect date format handling. The fix removes the .toISOString() call on the Date object when doing verifications cleanup.

Drizzle expects date to be passed as a Date object rather than string.

Error:

ERROR [Better Auth]: TypeError: value.toISOString is not a function

See more people having this issue on #1035

Edit -
Forgot to add that this bug is only present on v1.2 beta


🔄 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/1563 **Author:** [@focux](https://github.com/focux) **Created:** 2/24/2025 **Status:** ✅ Merged **Merged:** 2/24/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `v1.2` ← **Head:** `v1.2` --- ### 📝 Commits (1) - [`616363a`](https://github.com/better-auth/better-auth/commit/616363a264d917a0c4e5932d1cec9ec69de8733f) fix: oauth failing when using drizzle adapter ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/db/internal-adapter.ts` (+1 -1) </details> ### 📄 Description This PR addresses an issue with the Drizzle adapter where OAuth providers were failing due to incorrect date format handling. The fix removes the .toISOString() call on the Date object when doing verifications cleanup. Drizzle expects date to be passed as a Date object rather than string. Error: ``` ERROR [Better Auth]: TypeError: value.toISOString is not a function ``` See more people having this issue on #1035 **Edit -** Forgot to add that this bug is only present on v1.2 beta --- <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-04-17 20:47:48 -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#29465