[PR #8030] [MERGED] fix(oauth-provider): return "invalid_client" on encrypted secret verification failure #7698

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

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/8030
Author: @bytaesu
Created: 2/18/2026
Status: Merged
Merged: 2/18/2026
Merged by: @Bekacru

Base: canaryHead: 2026-02-18/fix/oauth-secret-error


📝 Commits (2)

  • 71f8467 fix(oauth-provider): return invalid_client on encrypted secret verification failure
  • c5eae1b test: update case to use test instance correctly

📊 Changes

2 files changed (+163 additions, -4 deletions)

View changed files

📝 packages/oauth-provider/src/token.test.ts (+149 -0)
📝 packages/oauth-provider/src/utils/index.ts (+14 -4)

📄 Description


Summary by cubic

Return invalid_client when encrypted client secret verification fails, instead of throwing. This prevents 500s on format mismatches and aligns with OAuth error semantics.

  • Bug Fixes
    • For storeClientSecret: "encrypted", catch decrypt/format errors and return false to surface invalid_client.
    • Custom decrypt storage unchanged; non-format decrypt errors still throw.
    • Tests cover encrypted mismatch and propagated custom decrypt errors; test setup uses the test instance correctly.

Written for commit c5eae1b718. 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/8030 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 2/18/2026 **Status:** ✅ Merged **Merged:** 2/18/2026 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `canary` ← **Head:** `2026-02-18/fix/oauth-secret-error` --- ### 📝 Commits (2) - [`71f8467`](https://github.com/better-auth/better-auth/commit/71f8467bd3e5231b0fd131f27df772570b2f167b) fix(oauth-provider): return invalid_client on encrypted secret verification failure - [`c5eae1b`](https://github.com/better-auth/better-auth/commit/c5eae1b7180bf4c724a27ff2d088b1d473e31aa7) test: update case to use test instance correctly ### 📊 Changes **2 files changed** (+163 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/oauth-provider/src/token.test.ts` (+149 -0) 📝 `packages/oauth-provider/src/utils/index.ts` (+14 -4) </details> ### 📄 Description - Closes #8016 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Return invalid_client when encrypted client secret verification fails, instead of throwing. This prevents 500s on format mismatches and aligns with OAuth error semantics. - **Bug Fixes** - For storeClientSecret: "encrypted", catch decrypt/format errors and return false to surface invalid_client. - Custom decrypt storage unchanged; non-format decrypt errors still throw. - Tests cover encrypted mismatch and propagated custom decrypt errors; test setup uses the test instance correctly. <sup>Written for commit c5eae1b7180bf4c724a27ff2d088b1d473e31aa7. 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:46: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#7698