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"
|
2022-11-11 22:17:44 -05:00
|
|
|
|
|
|
|
type UserId = string
|
|
|
|
|
|
|
|
declare module "next-auth/jwt" {
|
|
|
|
interface JWT {
|
|
|
|
id: UserId
|
|
|
|
role: string
|
2023-01-06 00:05:49 -05:00
|
|
|
sessionToken: string
|
2022-11-11 22:17:44 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare module "next-auth" {
|
|
|
|
interface Session {
|
|
|
|
user: User & {
|
|
|
|
id: UserId
|
|
|
|
role: string
|
2023-01-06 00:05:49 -05:00
|
|
|
sessionToken: string
|
2022-11-11 22:17:44 -05:00
|
|
|
}
|
|
|
|
}
|
2022-12-17 22:42:48 -05:00
|
|
|
|
|
|
|
// 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
|
2022-12-17 22:42:48 -05:00
|
|
|
}
|
2022-11-11 22:17:44 -05:00
|
|
|
}
|