[PR #6758] [MERGED] fix: properly merge updated data in account cookie #6869

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6758
Author: @jslno
Created: 12/14/2025
Status: Merged
Merged: 12/15/2025
Merged by: @Bekacru

Base: canaryHead: 12-14-2025/fix-account-cookie-refresh


📝 Commits (7)

  • bffda47 fix: account cookie not refreshed without database
  • e0c998c chore: cleanup
  • 9c47b27 fix(link-account): merge account with updates before setting cookie
  • 89a4cf2 chore: remove unwanted changes
  • 19ad283 fix: accessTokenExpired check
  • 6f5958d Revert "fix: accessTokenExpired check"
  • 91f1f4e Merge branch 'canary' into 12-14-2025/fix-account-cookie-refresh

📊 Changes

2 files changed (+22 additions, -17 deletions)

View changed files

📝 packages/better-auth/src/api/routes/account.ts (+18 -16)
📝 packages/better-auth/src/oauth2/link-account.ts (+4 -1)

📄 Description

closes #6770


Summary by cubic

Fixes account cookie not refreshing in stateless setups during token refresh and account linking.

  • Bug Fixes
    • Update the database only if account.id exists; otherwise merge refreshed token data into the account cookie.
    • Merge existing account data with updates before setting the cookie in the link-account flow.

Written for commit 91f1f4ef58. Summary will update automatically 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/6758 **Author:** [@jslno](https://github.com/jslno) **Created:** 12/14/2025 **Status:** ✅ Merged **Merged:** 12/15/2025 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `12-14-2025/fix-account-cookie-refresh` --- ### 📝 Commits (7) - [`bffda47`](https://github.com/better-auth/better-auth/commit/bffda47784601f54c3392088cdb2508a55189ccc) fix: account cookie not refreshed without database - [`e0c998c`](https://github.com/better-auth/better-auth/commit/e0c998c8bc41e24831611a88a2fe7c220c9fbef2) chore: cleanup - [`9c47b27`](https://github.com/better-auth/better-auth/commit/9c47b2787491bda34689f19df0e37df0c3835e0c) fix(link-account): merge account with updates before setting cookie - [`89a4cf2`](https://github.com/better-auth/better-auth/commit/89a4cf2ae9cc391259081a14698cbfcbcfc3f0b6) chore: remove unwanted changes - [`19ad283`](https://github.com/better-auth/better-auth/commit/19ad283692fc60a39debd3b7f14cab6dd985f63e) fix: accessTokenExpired check - [`6f5958d`](https://github.com/better-auth/better-auth/commit/6f5958d0863d67624d1a7b7416807419967648f5) Revert "fix: accessTokenExpired check" - [`91f1f4e`](https://github.com/better-auth/better-auth/commit/91f1f4ef5860ae103a761857255af965f6e31bd8) Merge branch 'canary' into 12-14-2025/fix-account-cookie-refresh ### 📊 Changes **2 files changed** (+22 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/account.ts` (+18 -16) 📝 `packages/better-auth/src/oauth2/link-account.ts` (+4 -1) </details> ### 📄 Description closes #6770 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes account cookie not refreshing in stateless setups during token refresh and account linking. - **Bug Fixes** - Update the database only if account.id exists; otherwise merge refreshed token data into the account cookie. - Merge existing account data with updates before setting the cookie in the link-account flow. <sup>Written for commit 91f1f4ef5860ae103a761857255af965f6e31bd8. Summary will update automatically 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:14:35 -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#6869