Edit: /tmp/tsx-0/17887-03226c828edd12363b0131ca5a1435a4507b31e5 (3971B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/vercel.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 vercel_exports={};__export(vercel_exports,{vercel:()=>vercel});module.exports=__toCommonJS(vercel_exports);var import_error=require(\"../error/index.mjs\");var import_create_authorization_url=require(\"../oauth2/create-authorization-url.mjs\");var import_validate_authorization_code=require(\"../oauth2/validate-authorization-code.mjs\");var import_oauth2=require(\"../oauth2/index.mjs\");var import_fetch=require(\"@better-fetch/fetch\");const vercel=__name(options=>{return{id:\"vercel\",name:\"Vercel\",createAuthorizationURL({state,scopes,codeVerifier,redirectURI}){if(!codeVerifier)throw new import_error.BetterAuthError(\"codeVerifier is required for Vercel\");let _scopes=void 0;if(options.scope!==void 0||scopes!==void 0){_scopes=[];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes)}return(0,import_create_authorization_url.createAuthorizationURL)({id:\"vercel\",options,authorizationEndpoint:\"https://vercel.com/oauth/authorize\",scopes:_scopes,state,codeVerifier,redirectURI})},validateAuthorizationCode:__name(async({code,codeVerifier,redirectURI})=>{return(0,import_validate_authorization_code.validateAuthorizationCode)({code,codeVerifier,redirectURI,options,tokenEndpoint:\"https://api.vercel.com/login/oauth/token\"})},\"validateAuthorizationCode\"),async getUserInfo(token){if(options.getUserInfo)return options.getUserInfo(token);const{data:profile,error}=await(0,import_fetch.betterFetch)(\"https://api.vercel.com/login/oauth/userinfo\",{headers:{Authorization:`Bearer ${token.accessToken}`}});if(error||!profile)return null;const userMap=await options.mapProfileToUser?.(profile);return{user:{id:profile.sub,name:profile.name??profile.preferred_username??\"\",email:profile.email,image:profile.picture,emailVerified:profile.email_verified??false,...userMap},data:profile}},options}},\"vercel\");0&&(module.exports={vercel});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,gIAAgC,8BAChC,oCAAuC,kDACvC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAG5B,MAAM,OAAS,OAAC,SAAY,CAC3B,MAAO,CACN,GAAI,SACJ,KAAM,SACN,uBAAuB,CAAE,MAAO,OAAQ,aAAc,WAAY,EAAG,CACpE,GAAI,CAAC,aAAc,MAAM,IAAI,6BAAgB,qCAAqC,EAClF,IAAI,QAAU,OACd,GAAI,QAAQ,QAAU,QAAU,SAAW,OAAQ,CAClD,QAAU,CAAC,EACX,GAAI,QAAQ,MAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,EAChD,GAAI,OAAQ,QAAQ,KAAK,GAAG,MAAM,CACnC,CACA,SAAO,wDAAuB,CAC7B,GAAI,SACJ,QACA,sBAAuB,qCACvB,OAAQ,QACR,MACA,aACA,WACD,CAAC,CACF,EACA,0BAA2B,aAAO,CAAE,KAAM,aAAc,WAAY,IAAM,CACzE,SAAO,8DAA0B,CAChC,KACA,aACA,YACA,QACA,cAAe,0CAChB,CAAC,CACF,EAR2B,6BAS3B,MAAM,YAAY,MAAO,CACxB,GAAI,QAAQ,YAAa,OAAO,QAAQ,YAAY,KAAK,EACzD,KAAM,CAAE,KAAM,QAAS,KAAM,EAAI,QAAM,0BAAY,8CAA+C,CAAE,QAAS,CAAE,cAAe,UAAU,MAAM,WAAW,EAAG,CAAE,CAAC,EAC/J,GAAI,OAAS,CAAC,QAAS,OAAO,KAC9B,MAAM,QAAU,MAAM,QAAQ,mBAAmB,OAAO,EACxD,MAAO,CACN,KAAM,CACL,GAAI,QAAQ,IACZ,KAAM,QAAQ,MAAQ,QAAQ,oBAAsB,GACpD,MAAO,QAAQ,MACf,MAAO,QAAQ,QACf,cAAe,QAAQ,gBAAkB,MACzC,GAAG,OACJ,EACA,KAAM,OACP,CACD,EACA,OACD,CACD,EAlDe","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/vercel.mjs"],"sourcesContent":[null]}}