[PR #8544] fix(oauth-provider): support prompt=none per OIDC spec #16297

Closed
opened 2026-04-13 10:29:13 -05:00 by GiteaMirror · 0 comments
Owner

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

State: closed
Merged: No


Summary

Adds prompt=none support to the new @better-auth/oauth-provider plugin per the OIDC specification.

  • When prompt=none is set and the user has no active session, redirect to redirect_uri with error=login_required instead of the login page
  • When prompt=none is set and consent is needed, redirect to redirect_uri with error=consent_required instead of the consent page
  • Add "none" to prompt_values_supported in the OIDC discovery metadata

Context

PR #8398 (commit 9dff8c5) fixed redirect_uri validation for prompt=none in the old oidc-provider plugin (packages/better-auth/src/plugins/oidc-provider/), but the same feature was missing in the new @better-auth/oauth-provider package (packages/oauth-provider/). As noted in this comment, the fix was applied to the wrong plugin.

Note: The redirect_uri validation security concern from #8398 is already handled by the new plugin's existing flow — redirect_uri is validated against the registered client URIs before reaching the prompt=none check.

Closes #7700

Test plan

  • login_required error returned when user is not authenticated with prompt=none
  • consent_required error returned when consent is needed with prompt=none
  • Invalid redirect_uri is rejected (not used for error redirects)
  • Metadata advertises "none" in prompt_values_supported
  • All existing oauth-provider tests still pass (50/50)

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/better-auth/better-auth/pull/8544 **State:** closed **Merged:** No --- ## Summary Adds `prompt=none` support to the new `@better-auth/oauth-provider` plugin per the OIDC specification. - When `prompt=none` is set and the user has **no active session**, redirect to `redirect_uri` with `error=login_required` instead of the login page - When `prompt=none` is set and **consent is needed**, redirect to `redirect_uri` with `error=consent_required` instead of the consent page - Add `"none"` to `prompt_values_supported` in the OIDC discovery metadata ## Context PR #8398 (commit 9dff8c5) fixed `redirect_uri` validation for `prompt=none` in the **old** `oidc-provider` plugin (`packages/better-auth/src/plugins/oidc-provider/`), but the same feature was missing in the **new** `@better-auth/oauth-provider` package (`packages/oauth-provider/`). As noted in [this comment](https://github.com/better-auth/better-auth/issues/7700#issuecomment-4035862756), the fix was applied to the wrong plugin. Note: The `redirect_uri` validation security concern from #8398 is already handled by the new plugin's existing flow — `redirect_uri` is validated against the registered client URIs before reaching the `prompt=none` check. Closes #7700 ## Test plan - [x] `login_required` error returned when user is not authenticated with `prompt=none` - [x] `consent_required` error returned when consent is needed with `prompt=none` - [x] Invalid `redirect_uri` is rejected (not used for error redirects) - [x] Metadata advertises `"none"` in `prompt_values_supported` - [x] All existing oauth-provider tests still pass (50/50) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
GiteaMirror added the pull-request label 2026-04-13 10:29:13 -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#16297