diff --git a/docs/content/docs/concepts/session-management.mdx b/docs/content/docs/concepts/session-management.mdx index 7562010326..879b7781a9 100644 --- a/docs/content/docs/concepts/session-management.mdx +++ b/docs/content/docs/concepts/session-management.mdx @@ -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] - }] + ] }) ```