[PR #8980] [MERGED] fix(oauth): prevent double-hashing of state when storeIdentifier is hashed #25244

Closed
opened 2026-04-15 22:47:09 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8980
Author: @bytaesu
Created: 4/6/2026
Status: Merged
Merged: 4/6/2026
Merged by: @gustavovalverde

Base: mainHead: 2026-04-06/fix/hashed-state-oauth-mismatch


📝 Commits (4)

  • 25dadac fix(oauth): prevent double-hashing of state when storeIdentifier is hashed
  • d296722 chore: add comments
  • efad602 chore: update comment
  • da46c4c chore: changeset

📊 Changes

3 files changed (+78 additions, -5 deletions)

View changed files

.changeset/pr-8980.md (+5 -0)
📝 packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts (+61 -0)
📝 packages/better-auth/src/state.ts (+12 -5)

📄 Description

https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/db/verification-token-storage.ts#L16-L18

This issue didn't surface before, because in the default plain mode, verification.identifier is the same as state.


🔄 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/8980 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 4/6/2026 **Status:** ✅ Merged **Merged:** 4/6/2026 **Merged by:** [@gustavovalverde](https://github.com/gustavovalverde) **Base:** `main` ← **Head:** `2026-04-06/fix/hashed-state-oauth-mismatch` --- ### 📝 Commits (4) - [`25dadac`](https://github.com/better-auth/better-auth/commit/25dadacb333d99761998f9f67515ba7a3ff77e9f) fix(oauth): prevent double-hashing of state when storeIdentifier is hashed - [`d296722`](https://github.com/better-auth/better-auth/commit/d2967223234b00f3eff167dc8bd17230cefec033) chore: add comments - [`efad602`](https://github.com/better-auth/better-auth/commit/efad6025e548f80b847a423b770fa0b9f3893c36) chore: update comment - [`da46c4c`](https://github.com/better-auth/better-auth/commit/da46c4cf8aaa5dd049bb4b0ab263614c747c02ff) chore: changeset ### 📊 Changes **3 files changed** (+78 additions, -5 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/pr-8980.md` (+5 -0) 📝 `packages/better-auth/src/plugins/generic-oauth/generic-oauth.test.ts` (+61 -0) 📝 `packages/better-auth/src/state.ts` (+12 -5) </details> ### 📄 Description https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/db/verification-token-storage.ts#L16-L18 This issue didn't surface before, because in the default plain mode, `verification.identifier` is the same as `state`. --- <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-15 22:47:09 -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#25244