Edit: /tmp/tsx-0/17887-0a455a3cbe67f576880640638c91b713459fd41b (4473B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/slack.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 slack_exports={};__export(slack_exports,{slack:()=>slack});module.exports=__toCommonJS(slack_exports);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_fetch=require(\"@better-fetch/fetch\");const slack=__name(options=>{const tokenEndpoint=\"https://slack.com/api/openid.connect.token\";return{id:\"slack\",name:\"Slack\",createAuthorizationURL({state,scopes,redirectURI}){const _scopes=options.disableDefaultScope?[]:[\"openid\",\"profile\",\"email\"];if(scopes)_scopes.push(...scopes);if(options.scope)_scopes.push(...options.scope);const url=new URL(\"https://slack.com/openid/connect/authorize\");url.searchParams.set(\"scope\",_scopes.join(\" \"));url.searchParams.set(\"response_type\",\"code\");url.searchParams.set(\"client_id\",options.clientId);url.searchParams.set(\"redirect_uri\",options.redirectURI||redirectURI);url.searchParams.set(\"state\",state);return url},validateAuthorizationCode:__name(async({code,redirectURI})=>{return(0,import_validate_authorization_code.validateAuthorizationCode)({code,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);const{data:profile,error}=await(0,import_fetch.betterFetch)(\"https://slack.com/api/openid.connect.userInfo\",{headers:{authorization:`Bearer ${token.accessToken}`}});if(error)return null;const userMap=await options.mapProfileToUser?.(profile);return{user:{id:profile[\"https://slack.com/user_id\"],name:profile.name||\"\",email:profile.email,emailVerified:profile.email_verified,image:profile.picture||profile[\"https://slack.com/user_image_512\"],...userMap},data:profile}},options}},\"slack\");0&&(module.exports={slack});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,0IAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAG5B,MAAM,MAAQ,OAAC,SAAY,CAC1B,MAAM,cAAgB,6CACtB,MAAO,CACN,GAAI,QACJ,KAAM,QACN,uBAAuB,CAAE,MAAO,OAAQ,WAAY,EAAG,CACtD,MAAM,QAAU,QAAQ,oBAAsB,CAAC,EAAI,CAClD,SACA,UACA,OACD,EACA,GAAI,OAAQ,QAAQ,KAAK,GAAG,MAAM,EAClC,GAAI,QAAQ,MAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,EAChD,MAAM,IAAM,IAAI,IAAI,4CAA4C,EAChE,IAAI,aAAa,IAAI,QAAS,QAAQ,KAAK,GAAG,CAAC,EAC/C,IAAI,aAAa,IAAI,gBAAiB,MAAM,EAC5C,IAAI,aAAa,IAAI,YAAa,QAAQ,QAAQ,EAClD,IAAI,aAAa,IAAI,eAAgB,QAAQ,aAAe,WAAW,EACvE,IAAI,aAAa,IAAI,QAAS,KAAK,EACnC,OAAO,GACR,EACA,0BAA2B,aAAO,CAAE,KAAM,WAAY,IAAM,CAC3D,SAAO,8DAA0B,CAChC,KACA,YACA,QACA,aACD,CAAC,CACF,EAP2B,6BAQ3B,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,KAAM,CAAE,KAAM,QAAS,KAAM,EAAI,QAAM,0BAAY,gDAAiD,CAAE,QAAS,CAAE,cAAe,UAAU,MAAM,WAAW,EAAG,CAAE,CAAC,EACjK,GAAI,MAAO,OAAO,KAClB,MAAM,QAAU,MAAM,QAAQ,mBAAmB,OAAO,EACxD,MAAO,CACN,KAAM,CACL,GAAI,QAAQ,2BAA2B,EACvC,KAAM,QAAQ,MAAQ,GACtB,MAAO,QAAQ,MACf,cAAe,QAAQ,eACvB,MAAO,QAAQ,SAAW,QAAQ,kCAAkC,EACpE,GAAG,OACJ,EACA,KAAM,OACP,CACD,EACA,OACD,CACD,EA3Dc","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/slack.mjs"],"sourcesContent":[null]}}