[PR #7216] [MERGED] fix: use accountId instead of id when looking up accounts #32753

Closed
opened 2026-04-17 23:29:53 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7216
Author: @bytaesu
Created: 1/9/2026
Status: Merged
Merged: 1/9/2026
Merged by: @Bekacru

Base: canaryHead: 2026-01-09/fix/account-id-lookup


📝 Commits (2)

  • 96a472c fix: use accountId instead of id when looking up accounts
  • dee49f0 test: add regression test for accountId lookup

📊 Changes

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

View changed files

📝 packages/better-auth/src/api/routes/account.test.ts (+21 -0)
📝 packages/better-auth/src/api/routes/account.ts (+2 -2)

📄 Description

Summary by cubic

Fix account lookup to use accountId when fetching access tokens and refreshing tokens. This aligns with listAccounts output and prevents token retrieval from failing when clients pass accountId.

  • Bug Fixes
    • Use accountId instead of id when matching accounts in getAccessToken and refreshToken.
    • Add regression test to ensure getAccessToken works with accountId from listAccounts.

Written for commit dee49f094c. 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/7216 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 1/9/2026 **Status:** ✅ Merged **Merged:** 1/9/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `2026-01-09/fix/account-id-lookup` --- ### 📝 Commits (2) - [`96a472c`](https://github.com/better-auth/better-auth/commit/96a472cf295f6c67e8ccacb009fd266734c4898a) fix: use accountId instead of id when looking up accounts - [`dee49f0`](https://github.com/better-auth/better-auth/commit/dee49f094cc27ccddfe7def6bd849d7e4e7c2793) test: add regression test for accountId lookup ### 📊 Changes **2 files changed** (+23 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/routes/account.test.ts` (+21 -0) 📝 `packages/better-auth/src/api/routes/account.ts` (+2 -2) </details> ### 📄 Description <!-- This is an auto-generated description by cubic. --> ## Summary by cubic Fix account lookup to use accountId when fetching access tokens and refreshing tokens. This aligns with listAccounts output and prevents token retrieval from failing when clients pass accountId. - **Bug Fixes** - Use accountId instead of id when matching accounts in getAccessToken and refreshToken. - Add regression test to ensure getAccessToken works with accountId from listAccounts. <sup>Written for commit dee49f094cc27ccddfe7def6bd849d7e4e7c2793. 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-04-17 23:29:53 -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#32753