From 830d5c075a934f3faebf216eb52cfcd245cdeb06 Mon Sep 17 00:00:00 2001 From: Hussein Raji <110731000+hussein-raji-mappa@users.noreply.github.com> Date: Thu, 20 Feb 2025 06:26:33 +0000 Subject: [PATCH] docs: update custom session example (#1508) --- docs/content/docs/concepts/session-management.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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] - }] + ] }) ```