"use strict";(()=>{var e={};e.id=873,e.ids=[873],e.modules={53524:e=>{e.exports=require("@prisma/client")},20399:e=>{e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},84770:e=>{e.exports=require("crypto")},83123:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>v,patchFetch:()=>f,requestAsyncStorage:()=>h,routeModule:()=>m,serverHooks:()=>g,staticGenerationAsyncStorage:()=>x});var a={};t.r(a),t.d(a,{POST:()=>c,dynamic:()=>d});var o=t(49303),n=t(88716),s=t(60670),i=t(87070),u=t(42023),p=t.n(u),l=t(72331);let d="force-dynamic";async function c(e){try{let{email:r,password:t}=await e.json();if(!r||!t)return i.NextResponse.json({error:"Email and password required"},{status:400});let a=await l._.user.findUnique({where:{email:r}});if(!a||!await p().compare(t,a.password))return i.NextResponse.json({error:"Invalid credentials"},{status:401});return i.NextResponse.json({id:a?.id,email:a?.email,name:a?.name,role:a?.role})}catch(e){return console.error("Login error:",e),i.NextResponse.json({error:"Login failed"},{status:500})}}let m=new o.AppRouteRouteModule({definition:{kind:n.x.APP_ROUTE,page:"/api/auth/login/route",pathname:"/api/auth/login",filename:"route",bundlePath:"app/api/auth/login/route"},resolvedPagePath:"/Users/jarolsanchez/Desktop/evotrucks/nextjs_space/app/api/auth/login/route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:h,staticGenerationAsyncStorage:x,serverHooks:g}=m,v="/api/auth/login/route";function f(){return(0,s.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:x})}},72331:(e,r,t)=>{t.d(r,{_:()=>o});var a=t(53524);let o=globalThis.prisma||new a.PrismaClient}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[948,598,70],()=>t(83123));module.exports=a})();