docs: update custom session example (#1508)

This commit is contained in:
Hussein Raji
2025-02-20 06:26:33 +00:00
committed by GitHub
parent 91bc0b74d7
commit 830d5c075a

View File

@@ -239,8 +239,8 @@ const options = {
export const auth = betterAuth({
...options,
plugins: [{
...options.plugins,
plugins: [
...(options.plugins ?? []),
customSession(async ({ user, session }) => {
// now both user and session will infer the fields added by plugins and your custom fields
return {
@@ -248,7 +248,7 @@ export const auth = betterAuth({
session
}
}, options), // pass options here // [!code highlight]
}]
]
})
```