Something broken with the customSession
plugins: [
customSession(async ({ user, session }) => {
const workspaces = await get_workspaces(user.id);
const onboarded = await has_completed_onboarding(user.id);
return {
user: {
...user,
onboarded: onboarded.ok,
workspace: workspaces[0]?.id,
},
session,
};
}),
],
plugins: [
customSession(async ({ user, session }) => {
const workspaces = await get_workspaces(user.id);
const onboarded = await has_completed_onboarding(user.id);
return {
user: {
...user,
onboarded: onboarded.ok,
workspace: workspaces[0]?.id,
},
session,
};
}),
],
Type '{ id: "custom-session"; endpoints: { getSession: { <C extends [(better_call.Context<"/get-session", { method: "GET"; metadata: { CUSTOM_SESSION: boolean; }; query: z.ZodOptional<z.ZodObject<{ disableCookieCache: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean, string>]>>; disableRefresh: z....' is not assignable to type 'BetterAuthPlugin'.
Types of property 'endpoints' are incompatible.
Type '{ id: "custom-session"; endpoints: { getSession: { <C extends [(better_call.Context<"/get-session", { method: "GET"; metadata: { CUSTOM_SESSION: boolean; }; query: z.ZodOptional<z.ZodObject<{ disableCookieCache: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodString, boolean, string>]>>; disableRefresh: z....' is not assignable to type 'BetterAuthPlugin'.
Types of property 'endpoints' are incompatible.
0 Replies