"use strict";(()=>{var e={};e.id=5870,e.ids=[5870],e.modules={53524:e=>{e.exports=require("@prisma/client")},30517:e=>{e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},2773:(e,r,t)=>{t.r(r),t.d(r,{headerHooks:()=>c,originalPathname:()=>A,requestAsyncStorage:()=>P,routeModule:()=>p,serverHooks:()=>l,staticGenerationAsyncStorage:()=>f,staticGenerationBailout:()=>v});var i={};t.r(i),t.d(i,{POST:()=>u}),t(95655);var a=t(83323),o=t(54647),n=t(66886),s=t(30953);async function u(e){try{let r=await e.json(),{email:t,otp:i}=r;if(!t||!i)return n.Z.json({error:"Email and OTP are required"},{status:400});let a=await s._.verificationToken.findUnique({where:{identifier_token:{identifier:t,token:i}}});if(!a)return n.Z.json({error:"Invalid OTP"},{status:400});if(new Date>a.expires)return await s._.verificationToken.delete({where:{identifier_token:{identifier:t,token:i}}}),n.Z.json({error:"OTP has expired"},{status:400});return n.Z.json({success:!0,message:"OTP Verified"})}catch(e){return console.error("Error verifying OTP:",e),n.Z.json({error:"Error verifying OTP"},{status:500})}}let d=a.AppRouteRouteModule,p=new d({definition:{kind:o.x.APP_ROUTE,page:"/api/auth/otp/verify/route",pathname:"/api/auth/otp/verify",filename:"route",bundlePath:"app/api/auth/otp/verify/route"},resolvedPagePath:".\\app\\api\\auth\\otp\\verify\\route.ts",nextConfigOutput:"standalone",userland:i}),{requestAsyncStorage:P,staticGenerationAsyncStorage:f,serverHooks:l,headerHooks:c,staticGenerationBailout:v}=p,A="/api/auth/otp/verify/route"},30953:(e,r,t)=>{t.d(r,{_:()=>o});var i=t(53524);let a=globalThis,o=a.prisma??new i.PrismaClient},54647:(e,r)=>{var t;Object.defineProperty(r,"x",{enumerable:!0,get:function(){return t}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE"}(t||(t={}))}};var r=require("../../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),i=r.X(0,[9727,3497,6886],()=>t(2773));module.exports=i})();