Edit: /tmp/tsx-0/17887-f752b701c0daeaea26ac4ebc9be1229b289c137c (3738B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/dist/plugins/oauth-proxy/utils.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 utils_exports={};__export(utils_exports,{checkSkipProxy:()=>checkSkipProxy,redirectOnError:()=>redirectOnError,resolveCurrentURL:()=>resolveCurrentURL,stripTrailingSlash:()=>stripTrailingSlash});module.exports=__toCommonJS(utils_exports);var import_url=require(\"../../utils/url.mjs\");var import_env=require(\"@better-auth/core/env\");function stripTrailingSlash(url){if(!url)return\"\";return url.replace(/\\/+$/,\"\")}__name(stripTrailingSlash,\"stripTrailingSlash\");function getVendorBaseURL(){const vercel=import_env.env.VERCEL_URL?`https://${import_env.env.VERCEL_URL}`:void 0;const netlify=import_env.env.NETLIFY_URL;const render=import_env.env.RENDER_URL;const aws=import_env.env.AWS_LAMBDA_FUNCTION_NAME;const google=import_env.env.GOOGLE_CLOUD_FUNCTION_NAME;const azure=import_env.env.AZURE_FUNCTION_NAME;return vercel||netlify||render||aws||google||azure}__name(getVendorBaseURL,\"getVendorBaseURL\");function resolveCurrentURL(ctx,opts){return new URL(opts?.currentURL||ctx.request?.url||getVendorBaseURL()||ctx.context.baseURL)}__name(resolveCurrentURL,\"resolveCurrentURL\");function checkSkipProxy(ctx,opts){if(ctx.request?.headers.get(\"x-skip-oauth-proxy\"))return true;const productionURL=opts?.productionURL||import_env.env.BETTER_AUTH_URL||ctx.context.baseURL;if(!productionURL)return false;const currentURL=opts?.currentURL||ctx.request?.url||getVendorBaseURL();if(!currentURL)return false;return(0,import_url.getOrigin)(productionURL)===(0,import_url.getOrigin)(currentURL)}__name(checkSkipProxy,\"checkSkipProxy\");function redirectOnError(ctx,errorURL,error){const sep=errorURL.includes(\"?\")?\"&\":\"?\";throw ctx.redirect(`${errorURL}${sep}error=${error}`)}__name(redirectOnError,\"redirectOnError\");0&&(module.exports={checkSkipProxy,redirectOnError,resolveCurrentURL,stripTrailingSlash});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,iQAA0B,+BAC1B,eAAoB,iCAMpB,SAAS,mBAAmB,IAAK,CAChC,GAAI,CAAC,IAAK,MAAO,GACjB,OAAO,IAAI,QAAQ,OAAQ,EAAE,CAC9B,CAHS,gDAOT,SAAS,kBAAmB,CAC3B,MAAM,OAAS,eAAI,WAAa,WAAW,eAAI,UAAU,GAAK,OAC9D,MAAM,QAAU,eAAI,YACpB,MAAM,OAAS,eAAI,WACnB,MAAM,IAAM,eAAI,yBAChB,MAAM,OAAS,eAAI,2BACnB,MAAM,MAAQ,eAAI,oBAClB,OAAO,QAAU,SAAW,QAAU,KAAO,QAAU,KACxD,CARS,4CAYT,SAAS,kBAAkB,IAAK,KAAM,CACrC,OAAO,IAAI,IAAI,MAAM,YAAc,IAAI,SAAS,KAAO,iBAAiB,GAAK,IAAI,QAAQ,OAAO,CACjG,CAFS,8CAMT,SAAS,eAAe,IAAK,KAAM,CAClC,GAAI,IAAI,SAAS,QAAQ,IAAI,oBAAoB,EAAG,MAAO,MAC3D,MAAM,cAAgB,MAAM,eAAiB,eAAI,iBAAmB,IAAI,QAAQ,QAChF,GAAI,CAAC,cAAe,MAAO,OAC3B,MAAM,WAAa,MAAM,YAAc,IAAI,SAAS,KAAO,iBAAiB,EAC5E,GAAI,CAAC,WAAY,MAAO,OACxB,SAAO,sBAAU,aAAa,OAAM,sBAAU,UAAU,CACzD,CAPS,wCAWT,SAAS,gBAAgB,IAAK,SAAU,MAAO,CAC9C,MAAM,IAAM,SAAS,SAAS,GAAG,EAAI,IAAM,IAC3C,MAAM,IAAI,SAAS,GAAG,QAAQ,GAAG,GAAG,SAAS,KAAK,EAAE,CACrD,CAHS","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/dist/plugins/oauth-proxy/utils.mjs"],"sourcesContent":[null]}}