From ba8f5b19c6b1fee0c00ec06e33263af03893553f Mon Sep 17 00:00:00 2001 From: Andres Date: Fri, 4 Apr 2025 13:01:55 +0200 Subject: [PATCH] add role to session obj --- src/server/auth/config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/auth/config.ts b/src/server/auth/config.ts index 06100f7..4c5fbe1 100644 --- a/src/server/auth/config.ts +++ b/src/server/auth/config.ts @@ -9,7 +9,7 @@ import { users, verificationTokens, } from '@/server/db/schema' - +type UserRole = 'user' | 'admin' /** * Module augmentation for `next-auth` types. Allows us to add custom properties to the `session` * object and keep type safety. @@ -22,7 +22,7 @@ declare module 'next-auth' { id: string discord_id: string // ...other properties - // role: UserRole; + role: UserRole } & DefaultSession['user'] } }