"use strict";(()=>{vare={};e.id=9971,e.ids=[9971],e.modules={75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},55511:e=>{e.exports=require("crypto")},29021:e=>{e.exports=require("fs")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){returnfunctione(r,t){returntinr?r[t]:"then"inr&&"function"==typeofr.then?r.then(r=>e(r,t)):"function"==typeofr&&"default"===t?r:void0}}})},24127:(e,r,t)=>{t.r(r),t.d(r,{config:()=>P,default:()=>l,routeModule:()=>f});vars={};t.r(s),t.d(s,{default:()=>d});varn=t(89947),o=t(2706),i=t(96762),a=t(14533),u=t.n(a),c=t(51348),p=t.n(c);asyncfunctiond(e,r){if("GET"!==e.method)returnr.json({msg:"UNauthorized"});{let{email:t,password:s}=e.query,n=u()({encryptionKey:process.env.DSQL_ENCRYPTION_PASSWORD||"",password:String(s)}),o=awaitp()(`UPDATE users SET password='${n}' WHERE email='${t}'`);r.json({success:!!o?.affectedRows})}}letl=(0,i.M)(s,"default"),P=(0,i.M)(s,"config"),f=newn.PagesAPIRouteModule({definition:{kind:o.A.PAGES_API,page:"/api/resetPassword",pathname:"/api/resetPassword",bundlePath:"",filename:""},userland:s})},14533:(e,r,t)=>{let{createHmac:s}=t(55511);e.exports=function({password:e,encryptionKey:r}){lett=r||process.env.DSQL_ENCRYPTION_PASSWORD;if(!t?.match(/.{8,}/))throwError("Encryption key is invalid");letn=s("sha512",t);returnn.update(e),n.digest("base64")}},51348:(e,r,t)=>{lets=t(9973),n=t(21580),o=s({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()}});asyncfunctioni(...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=i},21580:(e,r,t)=>{lets=t(29021);e.exports=function(){lete=process.env.DSQL_SSL_DIR;if(!e?.match(/./))return;letr=`${e}/ca-cert.pem`;if(!s.existsSync(r)){console.log(`${r} does not exist`);return}return{ca:s.readFileSync(`${e}/ca-cert.pem`)}}},2706:(e,r)=>{vart;Object.defineProperty(r,"A",{enumerable:!0,get:function(){returnt}}),function(e){e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE"}(t||(t={}))},89947:(e,r,t)=>{e.exports=t(75600)}};varr=require("../../webpack-api-runtime.js");r.C(e);vart=r(r.s=24127);module.exports=t})();