Files
Shifted/.next/server/app/api/auth/signup-customer/route.js
2026-02-10 01:14:19 +00:00

1 line
1.9 KiB
JavaScript

"use strict";(()=>{var e={};e.id=1570,e.ids=[1570],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")},84770:e=>{e.exports=require("crypto")},71761:(e,r,t)=>{t.r(r),t.d(r,{originalPathname:()=>x,patchFetch:()=>w,requestAsyncStorage:()=>c,routeModule:()=>m,serverHooks:()=>g,staticGenerationAsyncStorage:()=>h});var a={};t.r(a),t.d(a,{POST:()=>l});var s=t(49303),o=t(88716),i=t(60670),n=t(87070),u=t(42023),p=t.n(u),d=t(83493);async function l(e){try{let r=await e.json(),t=r.name,a=r.email,s=r.password;if(!t||!a||!s)return n.NextResponse.json({error:"name, email, and password are required."},{status:400});if(await d._.user.findUnique({where:{email:a.toLowerCase()}}))return n.NextResponse.json({error:"Email already in use."},{status:409});let o=await p().hash(s,10);return await d._.user.create({data:{name:t,email:a.toLowerCase(),passwordHash:o,role:"CUSTOMER"}}),n.NextResponse.json({ok:!0})}catch(e){return n.NextResponse.json({error:e?.message||"Failed to sign up."},{status:500})}}let m=new s.AppRouteRouteModule({definition:{kind:o.x.APP_ROUTE,page:"/api/auth/signup-customer/route",pathname:"/api/auth/signup-customer",filename:"route",bundlePath:"app/api/auth/signup-customer/route"},resolvedPagePath:"/root/ShiftedOffRoad/app/api/auth/signup-customer/route.ts",nextConfigOutput:"",userland:a}),{requestAsyncStorage:c,staticGenerationAsyncStorage:h,serverHooks:g}=m,x="/api/auth/signup-customer/route";function w(){return(0,i.patchFetch)({serverHooks:g,staticGenerationAsyncStorage:h})}},83493:(e,r,t)=>{t.d(r,{_:()=>s});let a=require("@prisma/client"),s=globalThis.prisma??new a.PrismaClient({log:["warn","error"]})}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),a=r.X(0,[9276,5972,2023],()=>t(71761));module.exports=a})();