CoastalCommitsPastes/types/next-auth.d.ts

36 lines
681 B
TypeScript
Raw Normal View History

2023-02-25 19:27:38 -05:00
import "@total-typescript/ts-reset";
2023-01-06 00:05:49 -05:00
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { User } from "next-auth"
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type { JWT } from "next-auth/jwt"
type UserId = string
declare module "next-auth/jwt" {
interface JWT {
id: UserId
role: string
2023-01-06 00:05:49 -05:00
sessionToken: string
}
}
declare module "next-auth" {
interface Session {
user: User & {
id: UserId
role: string
2023-01-06 00:05:49 -05:00
sessionToken: string
}
}
// override user
interface User {
username?: string | null
email?: string | null
role?: string | null
id: UserId
2023-01-06 00:05:49 -05:00
token?: string
}
}