"use strict";(()=>{vare={};e.id=9971,e.ids=[9971],e.modules={43499:e=>{e.exports=require("@moduletrace/datasquirel/functions/hashPassword")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,s){returnsinr?r[s]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,s)):"function"==typeofr&&"default"===s?r:void0}}})},24127:(e,r,s)=>{s.r(r),s.d(r,{config:()=>P,default:()=>l,routeModule:()=>f});vart={};s.r(t),s.d(t,{default:()=>p});varn=s(89947),o=s(2706),a=s(96762),i=s(51348),u=s.n(i),c=s(43499),d=s.n(c);asyncfunctionp(e,r){if("GET"!==e.method)returnr.json({msg:"UNauthorized"});{let{email:s,password:t}=e.query,n=d()({encryptionKey:process.env.DSQL_ENCRYPTION_PASSWORD||"",password:String(t)}),o=awaitu()(`UPDATE users SET password='${n}' WHERE email='${s}'`);r.json({success:!!o?.affectedRows})}}s(29021);letl=(0,a.M)(t,"default"),P=(0,a.M)(t,"config"),f=newn.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/resetPassword",pathname:"/api/resetPassword",bundlePath:"",filename:""},userland:t})},51348:(e,r,s)=>{lett=s(9973),n=s(21580),o=t({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void0,charset:"utf8mb4",ssl:n()}});asyncfunctiona(...e){try{letr=awaito.query(...e);returnawaito.end(),JSON.parse(JSON.stringify(r))}catch(e){returnconsole.log("DB Error =>",e),{success:!1,error:e.message}}}e.exports=a},21580:(e,r,s)=>{lett=s(29021);e.exports=function(){lete=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;letr=`${e}/ca-cert.pem`;if(!t.existsSync(r)){console.log(`${r} does not exist`);return}return{ca:t.readFileSync(`${e}/ca-cert.pem`)}}},2706:(e,r)=>{vars;Object.defineProperty(r,"A",{enumerable:!0,get:function(){returns}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(s||(s={}))},89947:(e,r,s)=>{e.exports=s(75600)}};varr=require("../../webpack-api-runtime.js");r.C(e);vars=r(r.s=24127);module.exports=s})();