From 2386b6ea3c3ee8ce57e24c8ce0f4f898b29e6d6d Mon Sep 17 00:00:00 2001 From: Sankalp Singh Date: Wed, 9 Oct 2024 15:05:29 +0530 Subject: [PATCH] Solved problems adding new attributes to user --- types/next-auth.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/types/next-auth.d.ts b/types/next-auth.d.ts index 32fd7ea05..b57090adc 100644 --- a/types/next-auth.d.ts +++ b/types/next-auth.d.ts @@ -3,9 +3,13 @@ import type { Role } from '@prisma/client'; import type { DefaultSession } from 'next-auth'; declare module 'next-auth' { - /** - * Returned by `useSession`, `getSession` and received as a prop on the `SessionProvider` React Context - */ + + interface User { + roles?: Array<{ + teamId: string; + role: Role; + }>; + } interface Session { user: DefaultSession['user'] & { id: string;