import type { DefaultSession, DefaultUser } from "next-auth"; import type { Role } from "@/lib/generated/prisma/enums"; declare module "next-auth" { interface Session { user: { id: string; role: Role; } & DefaultSession["user"]; } interface User extends DefaultUser { role: Role; } } // "next-auth/jwt" just re-exports from "@auth/core/jwt" (`export * from // ...`), so augmenting "next-auth/jwt" directly wouldn't merge with the // interface Auth.js's own callbacks actually use -- augment the real // source module instead. declare module "@auth/core/jwt" { interface JWT { role?: Role; } }