
import NextAuth, { DefaultSession } from "next-auth"
import { JWT } from "next-auth/jwt"

declare module "next-auth" {
    interface Session {
        user: {
            id: number
            email: string
            username: string
            first_name: string
            last_name: string
            is_admin: boolean
            is_active?: boolean
            email_verified?: boolean
        } & DefaultSession["user"]
        accessToken?: string
        refreshToken?: string
        error?: string
    }

    interface User {
        id: number
        email: string
        username: string
        first_name: string
        last_name: string
        is_admin: boolean
        is_active?: boolean
        email_verified?: boolean
        access_token?: string
        refresh_token?: string
    }
}

declare module "next-auth/jwt" {
    interface JWT {
        id: number
        email: string
        username: string
        first_name: string
        last_name: string
        is_admin: boolean
        is_active?: boolean
        accessToken?: string
        refreshToken?: string
        accessTokenExpires?: number
        error?: string
    }
}
