DatabaseHooks Session Create Before

  databaseHooks: {
    session: {
      create: {
        before: async (session) => {
          const activeOrganization = await getActiveOrganization(
            session.userId,
          );
          const activeOrganizationSlug = await getOrganizationSlug(
            activeOrganization?.id,
          );

          return {
            data: {
              ...session,
              activeOrganization: {
                id: activeOrganization?.id,
                slug: activeOrganizationSlug?.slug,
              },
            },
          };
        },
      },
    },
  },


Why won't authClient.getSession() show my new activeOrganization property with id an
slug
? I only see activeOrganizationId which I want to get rid of now that I am adding
slug
. I am pretty sure activeOrganizationIdis added automatically by the organization plugin
Was this page helpful?