//server side
//fetch db for extended data
plugins:[
customSession(async ({ user, session }) => {
const resumeCount = 10;
return {
user: {
...user,
extended data
},
session
};
}),
]//client side
// ... imports
const client = createAuthClient({
baseURL: "http://localhost:5000",
// ...
});
type Session = typeof client.$Infer.Session;
export const auth = client as Omit<typeof client, "useSession"> & {
useSession: () => {
data: (Session & {
user: Session["user"] & { yourcustomdata: number };
}) | null;
isPending: boolean;
error: any;
refetch: () => void;
};
};
