Edit: /tmp/tsx-0/17887-9e0401f766639e5307995ae90672a28558db37e6 (4962B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/paybin.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 paybin_exports={};__export(paybin_exports,{paybin:()=>paybin});module.exports=__toCommonJS(paybin_exports);var import_logger=require(\"../env/logger.mjs\");var import_env=require(\"../env/index.mjs\");var import_error=require(\"../error/index.mjs\");var import_create_authorization_url=require(\"../oauth2/create-authorization-url.mjs\");var import_refresh_access_token=require(\"../oauth2/refresh-access-token.mjs\");var import_validate_authorization_code=require(\"../oauth2/validate-authorization-code.mjs\");var import_oauth2=require(\"../oauth2/index.mjs\");var import_jose=require(\"jose\");const paybin=__name(options=>{const issuer=options.issuer||\"https://idp.paybin.io\";const authorizationEndpoint=`${issuer}/oauth2/authorize`;const tokenEndpoint=`${issuer}/oauth2/token`;return{id:\"paybin\",name:\"Paybin\",async createAuthorizationURL({state,scopes,codeVerifier,redirectURI,loginHint}){if(!options.clientId||!options.clientSecret){import_logger.logger.error(\"Client Id and Client Secret is required for Paybin. Make sure to provide them in the options.\");throw new import_error.BetterAuthError(\"CLIENT_ID_AND_SECRET_REQUIRED\")}if(!codeVerifier)throw new import_error.BetterAuthError(\"codeVerifier is required for Paybin\");const _scopes=options.disableDefaultScope?[]:[\"openid\",\"email\",\"profile\"];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes);return await(0,import_create_authorization_url.createAuthorizationURL)({id:\"paybin\",options,authorizationEndpoint,scopes:_scopes,state,codeVerifier,redirectURI,prompt:options.prompt,loginHint})},validateAuthorizationCode:__name(async({code,codeVerifier,redirectURI})=>{return(0,import_validate_authorization_code.validateAuthorizationCode)({code,codeVerifier,redirectURI,options,tokenEndpoint})},\"validateAuthorizationCode\"),refreshAccessToken:options.refreshAccessToken?options.refreshAccessToken:async refreshToken=>{return(0,import_refresh_access_token.refreshAccessToken)({refreshToken,options:{clientId:options.clientId,clientKey:options.clientKey,clientSecret:options.clientSecret},tokenEndpoint})},async getUserInfo(token){if(options.getUserInfo)return options.getUserInfo(token);if(!token.idToken)return null;const user=(0,import_jose.decodeJwt)(token.idToken);const userMap=await options.mapProfileToUser?.(user);return{user:{id:user.sub,name:user.name||user.preferred_username||\"\",email:user.email,image:user.picture,emailVerified:user.email_verified||false,...userMap},data:user}},options}},\"paybin\");0&&(module.exports={paybin});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,iIAAuB,6BACvB,eAAO,4BACP,iBAAgC,8BAChC,oCAAuC,kDACvC,gCAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,gBAA0B,gBAG1B,MAAM,OAAS,OAAC,SAAY,CAC3B,MAAM,OAAS,QAAQ,QAAU,wBACjC,MAAM,sBAAwB,GAAG,MAAM,oBACvC,MAAM,cAAgB,GAAG,MAAM,gBAC/B,MAAO,CACN,GAAI,SACJ,KAAM,SACN,MAAM,uBAAuB,CAAE,MAAO,OAAQ,aAAc,YAAa,SAAU,EAAG,CACrF,GAAI,CAAC,QAAQ,UAAY,CAAC,QAAQ,aAAc,CAC/C,qBAAO,MAAM,+FAA+F,EAC5G,MAAM,IAAI,6BAAgB,+BAA+B,CAC1D,CACA,GAAI,CAAC,aAAc,MAAM,IAAI,6BAAgB,qCAAqC,EAClF,MAAM,QAAU,QAAQ,oBAAsB,CAAC,EAAI,CAClD,SACA,QACA,SACD,EACA,GAAI,QAAQ,MAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,EAChD,GAAI,OAAQ,QAAQ,KAAK,GAAG,MAAM,EAClC,OAAO,QAAM,wDAAuB,CACnC,GAAI,SACJ,QACA,sBACA,OAAQ,QACR,MACA,aACA,YACA,OAAQ,QAAQ,OAChB,SACD,CAAC,CACF,EACA,0BAA2B,aAAO,CAAE,KAAM,aAAc,WAAY,IAAM,CACzE,SAAO,8DAA0B,CAChC,KACA,aACA,YACA,QACA,aACD,CAAC,CACF,EAR2B,6BAS3B,mBAAoB,QAAQ,mBAAqB,QAAQ,mBAAqB,MAAO,cAAiB,CACrG,SAAO,gDAAmB,CACzB,aACA,QAAS,CACR,SAAU,QAAQ,SAClB,UAAW,QAAQ,UACnB,aAAc,QAAQ,YACvB,EACA,aACD,CAAC,CACF,EACA,MAAM,YAAY,MAAO,CACxB,GAAI,QAAQ,YAAa,OAAO,QAAQ,YAAY,KAAK,EACzD,GAAI,CAAC,MAAM,QAAS,OAAO,KAC3B,MAAM,QAAO,uBAAU,MAAM,OAAO,EACpC,MAAM,QAAU,MAAM,QAAQ,mBAAmB,IAAI,EACrD,MAAO,CACN,KAAM,CACL,GAAI,KAAK,IACT,KAAM,KAAK,MAAQ,KAAK,oBAAsB,GAC9C,MAAO,KAAK,MACZ,MAAO,KAAK,QACZ,cAAe,KAAK,gBAAkB,MACtC,GAAG,OACJ,EACA,KAAM,IACP,CACD,EACA,OACD,CACD,EAvEe","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/paybin.mjs"],"sourcesContent":[null]}}