xiaso-flnxi-website/types/next-auth.d.ts
2025-12-21 19:28:31 +08:00

39 lines
665 B
TypeScript

import NextAuth, { DefaultSession, DefaultUser } from "next-auth"
import { JWT } from "next-auth/jwt"
declare module "next-auth" {
/**
* 扩展 Session 类型
*/
interface Session {
user: {
id: string
email?: string | null
name?: string | null
provider?: string
} & DefaultSession["user"]
}
/**
* 扩展 User 类型
*/
interface User extends DefaultUser {
id: string
provider?: string
}
}
declare module "next-auth/jwt" {
/**
* 扩展 JWT 类型
*/
interface JWT {
id: string
provider?: string
picture?: string | null
email?: string | null
name?: string | null
}
}