mirror of
https://github.com/harivansh-afk/Saas-Teamspace.git
synced 2026-04-15 03:00:47 +00:00
17 lines
425 B
TypeScript
17 lines
425 B
TypeScript
import { UserRole } from '@prisma/client'
|
|
import NextAuth, { type DefaultSession } from 'next-auth'
|
|
|
|
// write extended user
|
|
|
|
// It is a bit messy, so in the future, checkout the docs for a better way to do this (authjs.dev/getting-started/typescript)
|
|
|
|
export type ExtendedUser = DefaultSession['user'] & {
|
|
role: UserRole
|
|
}
|
|
|
|
declare module 'next-auth' {
|
|
interface Session {
|
|
user: ExtendedUser
|
|
userId: string
|
|
}
|
|
}
|