[PR #5912] [MERGED] fix(oidc-provider): oidc_login_prompt not cleared after login #23216

Closed
opened 2026-04-15 21:33:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/5912
Author: @himself65
Created: 11/11/2025
Status: Merged
Merged: 11/12/2025
Merged by: @himself65

Base: canaryHead: himself65/2025/11/11/spec


📝 Commits (2)

  • 34c7be1 fix(oidc): oidc_login_prompt not cleared after login
  • c173710 fix: code

📊 Changes

3 files changed (+115 additions, -43 deletions)

View changed files

📝 packages/better-auth/src/plugins/mcp/index.ts (+20 -20)
📝 packages/better-auth/src/plugins/oidc-provider/index.ts (+19 -23)
📝 test/unit/oidc/index.spec.ts (+76 -0)

📄 Description

Closes https://github.com/better-auth/better-auth/issues/4594


Summary by cubic

Fixes the OIDC flow so the oidc_login_prompt cookie is cleared after login, preventing repeated consent prompts. The cookie is now removed once a valid session is detected.

  • Bug Fixes
    • Validate session with getSessionFromCtx and ctx.context.newSession instead of parsing Set-Cookie headers.
    • Clear oidc_login_prompt when a session exists in both mcp and oidc-provider plugins via post-login middleware.
    • Added a unit test that verifies the cookie is cleared after sign-up/login.

Written for commit c173710244. 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/5912 **Author:** [@himself65](https://github.com/himself65) **Created:** 11/11/2025 **Status:** ✅ Merged **Merged:** 11/12/2025 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `himself65/2025/11/11/spec` --- ### 📝 Commits (2) - [`34c7be1`](https://github.com/better-auth/better-auth/commit/34c7be1926e84c91997855942bcdb847ab177978) fix(oidc): `oidc_login_prompt` not cleared after login - [`c173710`](https://github.com/better-auth/better-auth/commit/c173710244cda86aa36301a44e809007d1c57279) fix: code ### 📊 Changes **3 files changed** (+115 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/plugins/mcp/index.ts` (+20 -20) 📝 `packages/better-auth/src/plugins/oidc-provider/index.ts` (+19 -23) 📝 `test/unit/oidc/index.spec.ts` (+76 -0) </details> ### 📄 Description Closes https://github.com/better-auth/better-auth/issues/4594 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Fixes the OIDC flow so the oidc_login_prompt cookie is cleared after login, preventing repeated consent prompts. The cookie is now removed once a valid session is detected. - **Bug Fixes** - Validate session with getSessionFromCtx and ctx.context.newSession instead of parsing Set-Cookie headers. - Clear oidc_login_prompt when a session exists in both mcp and oidc-provider plugins via post-login middleware. - Added a unit test that verifies the cookie is cleared after sign-up/login. <sup>Written for commit c173710244cda86aa36301a44e809007d1c57279. 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-04-15 21:33:21 -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#23216