(()=>{var e={};e.id=8281,e.ids=[8281],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},24429:()=>{},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},42329:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>f,routeModule:()=>u,serverHooks:()=>l,workAsyncStorage:()=>c,workUnitAsyncStorage:()=>d});var s={};t.r(s),t.d(s,{POST:()=>p});var o=t(30781),a=t(60554),n=t(31625),i=t(96396);async function p(e){try{let r=await e.json();console.log(r);let t=await fetch("http://localhost:3001/api/auth/verify-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}),s=await t.json();if(console.log("Verify response:",s),!t.ok)return i.NextResponse.json({error:s.error||"Verification failed"},{status:t.status});let o="/";switch(s?.user?.role){case"patient":o="/dashboard/patient/profile";break;case"doctor":o="/dashboard/doctor/profile";break;case"lab":o="/dashboard/lab/profile";break;case"pharmacy":o="/dashboard/pharmacy/profile";break;default:o="/dashboard"}return i.NextResponse.json({success:!0,redirectUrl:o,user:s.user},{status:200})}catch(e){return console.error("Verification error:",e),i.NextResponse.json({error:"Internal server error"},{status:500})}}let u=new o.AppRouteRouteModule({definition:{kind:a.RouteKind.APP_ROUTE,page:"/api/verify-code/route",pathname:"/api/verify-code",filename:"route",bundlePath:"app/api/verify-code/route"},resolvedPagePath:"/home/kencert/Desktop/Work/consultingsystem/frontend/app/api/verify-code/route.js",nextConfigOutput:"",userland:s}),{workAsyncStorage:c,workUnitAsyncStorage:d,serverHooks:l}=u;function f(){return(0,n.patchFetch)({workAsyncStorage:c,workUnitAsyncStorage:d})}},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},64749:()=>{}};var r=require("../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[1625,9146],()=>t(42329));module.exports=s})();