feat(oidc-provider): support prompt=create

This commit is contained in:
Gustavo Valverde
2025-12-13 21:17:22 +00:00
parent 184f378ef3
commit d13cdd034e
7 changed files with 108 additions and 6 deletions
@@ -349,6 +349,10 @@ export const auth = betterAuth({
You don't need to handle anything from your side; when a new session is created, the plugin will handle continuing the authorization flow.
### Initiating Registration (`prompt=create`)
Better Auth supports the OpenID Connect Prompt Create extension. When an authorization request includes `prompt=create` and the user is not authenticated, Better Auth will redirect the user to `createAccountPage` (if provided) instead of `loginPage`. If `createAccountPage` is not set, the user will be redirected to `loginPage` and you can render a sign-up experience based on the `prompt` query parameter.
## Configuration
### OIDC Metadata
@@ -620,6 +624,8 @@ Table Name: `oauthConsent`
**loginPage**: `string` - Path to the custom login page.
**createAccountPage**: `string` - Path to the custom create account (sign-up) page. When an authorization request includes `prompt=create`, unauthenticated users will be redirected here instead of `loginPage`.
**consentPage**: `string` - Path to the custom consent page.
**trustedClients**: `(Client & { skipConsent?: boolean })[]` - Array of trusted clients that are configured directly in the provider options. These clients bypass database lookups and can optionally skip consent screens.