dsql-admin/dsql-app/.local_dist/server/pages/api/resetPassword.js

1 line
2.9 KiB
JavaScript
Raw Normal View History

2025-02-19 19:38:56 +00:00
"use strict";(()=>{var e={};e.id=9971,e.ids=[9971],e.modules={28187:e=>{e.exports=require("@moduletrace/datasquirel")},75600:e=>{e.exports=require("next/dist/compiled/next-server/pages-api.runtime.prod.js")},9973:e=>{e.exports=require("serverless-mysql")},96762:(e,r)=>{Object.defineProperty(r,"M",{enumerable:!0,get:function(){return function e(r,s){return s in r?r[s]:"then"in r&&"function"==typeof r.then?r.then(r=>e(r,s)):"function"==typeof r&&"default"===s?r:void 0}}})},23297:(e,r,s)=>{s.r(r),s.d(r,{config:()=>S,default:()=>u,routeModule:()=>p});var o={};s.r(o),s.d(o,{default:()=>c});var n=s(89947),t=s(2706),_=s(96762),a=s(48786),D=s(28187),i=s.n(D);async function c(e,r){if("GET"!==e.method)return r.json({msg:"UNauthorized"});{let{email:s,password:o}=e.query,n=i().utils.crypto.hashPassword({password:String(o)}),t=await (0,a.A)(`UPDATE users SET password='${n}' WHERE email='${s}'`);r.json({success:!!t?.affectedRows})}}let u=(0,_.M)(o,"default"),S=(0,_.M)(o,"config"),p=new n.PagesAPIRouteModule({definition:{kind:t.A.PAGES_API,page:"/api/resetPassword",pathname:"/api/resetPassword",bundlePath:"",filename:""},userland:o})},48786:(e,r,s)=>{s.d(r,{A:()=>n});var o=s(7447);async function n(...e){let r=(0,o.A)();try{if(!r)throw Error("No Connection provided to DB_HANDLER function!");let s=await r.query(...e);return JSON.parse(JSON.stringify(s))}catch(e){return global.ERROR_CALLBACK?.("DB_HANDLER Error",e),{success:!1,error:e.message}}finally{await r?.end()}}},7447:(e,r,s)=>{s.d(r,{A:()=>t});var o=s(9973),n=s.n(o);function t(e){return global.DSQL_USE_LOCAL||e?.local?global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.ro?global.DSQL_READ_ONLY_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_READ_ONLY_USERNAME,password:process.env.DSQL_DB_READ_ONLY_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):e?.fa?global.DSQL_FULL_ACCESS_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_FULL_ACCESS_USERNAME,password:process.env.DSQL_DB_FULL_ACCESS_PASSWORD,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}}):global.DSQL_DB_CONN||n()({config:{host:process.env.DSQL_DB_HOST,user:process.env.DSQL_DB_USERNAME,password:process.env.DSQL_DB_PASSWORD,database:e?.noDb?void 0:process.env.DSQL_DB_NAME,port:process.env.DSQL_DB_PORT?Number(process.env.DSQL_DB_PORT):void 0,charset:"utf8mb4"}})}},2706:(e,r)=>{Object.defineProperty(r,"A",{enumerable:!0,get:function(){return s}});var s=function(e){return e.PAGES="PAGES",e.PAGES_API="PAGES_API",e.APP_PAGE="APP_PAGE",e.APP_ROUTE="APP_ROUTE",e.IMAGE="IMAGE",e}({})},89947:(e,r,s)=>{e.exports=s(75600)}};var r=require("../../webpack-api-runtime.js");r.C(e);var s=r(r.s=23297);module.exports=s})();