CoastalCommitsPastes/src/types/next-auth.d.ts

29 lines
438 B
TypeScript
Raw Normal View History

import { User } from "next-auth"
import { JWT } from "next-auth/jwt"
type UserId = string
declare module "next-auth/jwt" {
interface JWT {
id: UserId
role: string
}
}
declare module "next-auth" {
interface Session {
user: User & {
id: UserId
role: string
}
}
// override user
interface User {
username?: string | null
email?: string | null
role?: string | null
id: UserId
}
}