mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 12:27:44 +00:00
docs: advanced field includes the option to generateId (#1756)
This commit is contained in:
@@ -371,7 +371,14 @@ export const auth = betterAuth({
|
|||||||
httpOnly: true,
|
httpOnly: true,
|
||||||
secure: true
|
secure: true
|
||||||
},
|
},
|
||||||
cookiePrefix: "myapp"
|
cookiePrefix: "myapp",
|
||||||
|
generateId: ((options: {
|
||||||
|
model: LiteralUnion<Models, string>;
|
||||||
|
size?: number;
|
||||||
|
}) => {
|
||||||
|
// Generate a unique ID for the model
|
||||||
|
return "my-id";
|
||||||
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
@@ -383,6 +390,7 @@ export const auth = betterAuth({
|
|||||||
- `cookies`: Customize cookie names and attributes
|
- `cookies`: Customize cookie names and attributes
|
||||||
- `defaultCookieAttributes`: Default attributes for all cookies
|
- `defaultCookieAttributes`: Default attributes for all cookies
|
||||||
- `cookiePrefix`: Prefix for cookies
|
- `cookiePrefix`: Prefix for cookies
|
||||||
|
- `generateId`: Function to generate a unique ID for a model
|
||||||
|
|
||||||
## `databaseHooks`
|
## `databaseHooks`
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user