"use strict";(()=>{var e={};e.id=2748,e.ids=[2748],e.modules={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")},7407:(e,r,i)=>{i.r(r),i.d(r,{originalPathname:()=>v,patchFetch:()=>c,requestAsyncStorage:()=>d,routeModule:()=>p,serverHooks:()=>f,staticGenerationAsyncStorage:()=>m});var a={};i.r(a),i.d(a,{GET:()=>l});var t=i(49303),s=i(88716),n=i(60670),o=i(87070),u=i(8194);async function l(e){try{let r=e.nextUrl.searchParams.get("token");if(!r)return o.NextResponse.json({error:"Token verifikasi tidak ditemukan"},{status:400});let i=await u._.user.findUnique({where:{verificationToken:r}});if(!i)return o.NextResponse.json({error:"Token verifikasi tidak valid"},{status:400});if(i.emailVerified)return o.NextResponse.json({message:"Email sudah diverifikasi sebelumnya"});if(i.verificationExpiry&&new Date>i.verificationExpiry)return o.NextResponse.json({error:"Token verifikasi sudah kedaluwarsa. Silakan minta kirim ulang."},{status:400});return await u._.user.update({where:{id:i.id},data:{emailVerified:!0,verificationToken:null,verificationExpiry:null}}),o.NextResponse.json({message:"Email berhasil diverifikasi! Silakan login."})}catch(e){return console.error("Verify email error:",e),o.NextResponse.json({error:"Terjadi kesalahan server"},{status:500})}}let p=new t.AppRouteRouteModule({definition:{kind:s.x.APP_ROUTE,page:"/api/auth/verify-email/route",pathname:"/api/auth/verify-email",filename:"route",bundlePath:"app/api/auth/verify-email/route"},resolvedPagePath:"D:\\PROJECT\\resto-saas\\src\\app\\api\\auth\\verify-email\\route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:d,staticGenerationAsyncStorage:m,serverHooks:f}=p,v="/api/auth/verify-email/route";function c(){return(0,n.patchFetch)({serverHooks:f,staticGenerationAsyncStorage:m})}},8194:(e,r,i)=>{i.d(r,{_:()=>t});let a=require("@prisma/client"),t=globalThis.prisma??new a.PrismaClient}};var r=require("../../../../webpack-runtime.js");r.C(e);var i=e=>r(r.s=e),a=r.X(0,[8948,5972],()=>i(7407));module.exports=a})();