import NextAuth from "next-auth";
import { authOptions } from "../authOptions";
import { prisma } from "@/lib/prisma"; // Adapte selon ton projet
import { compare } from "bcryptjs";
import { Role } from '@/types/types';

declare module 'next-auth' {
  interface User {
    role: Role;
  }
  interface Session {
    user: User & {
      role: Role;
    };
  }
}

declare module 'next-auth/jwt' {
  interface JWT {
    role: Role;
  }
}

const handler = NextAuth(authOptions);
export { handler as GET, handler as POST };
