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

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

Original Pull Request: https://github.com/better-auth/better-auth/pull/5912

State: closed
Merged: Yes


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.

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/5912 **State:** closed **Merged:** Yes --- 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. -->
GiteaMirror added the pull-request label 2026-04-13 09:31:46 -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#14562