docs: document oauthConfig in options.mdx (#5947)

This commit is contained in:
Maxwell
2025-11-13 20:09:06 +00:00
committed by GitHub
parent fa595a8c3b
commit 9ce76beefc
2 changed files with 15 additions and 1 deletions
@@ -34,6 +34,15 @@ same browser session that started it.
* Check that cookies are not blocked by browser settings or privacy modes.
* Ensure you're starting and ending the OAuth flow in the same browser session.
### Skip state cookie check
If you know what you are doing, you can skip the state cookie check by
setting the `advanced.oauthConfig.skipStateCookieCheck` option to `true` in your auth config.
<Callout type="warn">
Please note that this is a security risk and should only be enabled if you know what you are doing.
</Callout>
### Production Debug
Head to your production site, and use your browser's DevTools → Application → Cookies to confirm:
+6 -1
View File
@@ -465,6 +465,10 @@ export const auth = betterAuth({
httpOnly: true,
secure: true
},
oauthConfig: {
skipStateCookieCheck: false,
storeStateStrategy: "database"
},
cookiePrefix: "myapp",
database: {
// Use your own custom ID generator, disable generating IDS so your database will generate them, or use "serial" to use your database's auto-incrementing ID, or "uuid" to use a random UUID.
@@ -487,7 +491,8 @@ export const auth = betterAuth({
- `cookies`: Customize cookie names and attributes
- `defaultCookieAttributes`: Default attributes for all cookies
- `cookiePrefix`: Prefix for cookies
- `generateId`: Function to generate a unique ID for a model
- `database`: Database configuration options
- `oauthConfig`: OAuth configuration options
## `logger`