Edit: /tmp/tsx-0/17887-6e690c972c548f0a7aa1115ec76b0699837d5ab2 (2986B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/utils/password.mjs\";(()=>{\nvar __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __name=(target,value)=>__defProp(target,\"name\",{value,configurable:true});var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from===\"object\"||typeof from===\"function\"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},\"__esModule\",{value:true}),mod);var password_exports={};__export(password_exports,{checkPassword:()=>checkPassword,validatePassword:()=>validatePassword});module.exports=__toCommonJS(password_exports);var import_error=require(\"@better-auth/core/error\");async function validatePassword(ctx,data){const credentialAccount=(await ctx.context.internalAdapter.findAccounts(data.userId))?.find(account=>account.providerId===\"credential\");const currentPassword=credentialAccount?.password;if(!credentialAccount||!currentPassword)return false;return await ctx.context.password.verify({hash:currentPassword,password:data.password})}__name(validatePassword,\"validatePassword\");async function checkPassword(userId,c){const credentialAccount=(await c.context.internalAdapter.findAccounts(userId))?.find(account=>account.providerId===\"credential\");const currentPassword=credentialAccount?.password;if(!credentialAccount||!currentPassword||!c.body.password)throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.CREDENTIAL_ACCOUNT_NOT_FOUND);if(!await c.context.password.verify({hash:currentPassword,password:c.body.password}))throw import_error.APIError.from(\"BAD_REQUEST\",import_error.BASE_ERROR_CODES.INVALID_PASSWORD);return true}__name(checkPassword,\"checkPassword\");0&&(module.exports={checkPassword,validatePassword});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,0LAA2C,mCAG3C,eAAe,iBAAiB,IAAK,KAAM,CAC1C,MAAM,mBAAqB,MAAM,IAAI,QAAQ,gBAAgB,aAAa,KAAK,MAAM,IAAI,KAAM,SAAY,QAAQ,aAAe,YAAY,EAC9I,MAAM,gBAAkB,mBAAmB,SAC3C,GAAI,CAAC,mBAAqB,CAAC,gBAAiB,MAAO,OACnD,OAAO,MAAM,IAAI,QAAQ,SAAS,OAAO,CACxC,KAAM,gBACN,SAAU,KAAK,QAChB,CAAC,CACF,CARe,4CASf,eAAe,cAAc,OAAQ,EAAG,CACvC,MAAM,mBAAqB,MAAM,EAAE,QAAQ,gBAAgB,aAAa,MAAM,IAAI,KAAM,SAAY,QAAQ,aAAe,YAAY,EACvI,MAAM,gBAAkB,mBAAmB,SAC3C,GAAI,CAAC,mBAAqB,CAAC,iBAAmB,CAAC,EAAE,KAAK,SAAU,MAAM,sBAAS,KAAK,cAAe,8BAAiB,4BAA4B,EAChJ,GAAI,CAAC,MAAM,EAAE,QAAQ,SAAS,OAAO,CACpC,KAAM,gBACN,SAAU,EAAE,KAAK,QAClB,CAAC,EAAG,MAAM,sBAAS,KAAK,cAAe,8BAAiB,gBAAgB,EACxE,MAAO,KACR,CATe","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/utils/password.mjs"],"sourcesContent":[null]}}