Edit: /tmp/tsx-0/17887-6a8b567126ade03d79a0baa657041b52886b2752 (4356B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/roblox.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 roblox_exports={};__export(roblox_exports,{roblox:()=>roblox});module.exports=__toCommonJS(roblox_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 roblox=__name(options=>{const tokenEndpoint=\"https://apis.roblox.com/oauth/v1/token\";return{id:\"roblox\",name:\"Roblox\",createAuthorizationURL({state,scopes,redirectURI}){const _scopes=options.disableDefaultScope?[]:[\"openid\",\"profile\"];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes);return new URL(`https://apis.roblox.com/oauth/v1/authorize?scope=${_scopes.join(\"+\")}&response_type=code&client_id=${options.clientId}&redirect_uri=${encodeURIComponent(options.redirectURI||redirectURI)}&state=${state}&prompt=${options.prompt||\"select_account consent\"}`)},validateAuthorizationCode:__name(async({code,redirectURI})=>{return(0,import_validate_authorization_code.validateAuthorizationCode)({code,redirectURI:options.redirectURI||redirectURI,options,tokenEndpoint,authentication:\"post\"})},\"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://apis.roblox.com/oauth/v1/userinfo\",{headers:{authorization:`Bearer ${token.accessToken}`}});if(error)return null;const userMap=await options.mapProfileToUser?.(profile);return{user:{id:profile.sub,name:profile.nickname||profile.preferred_username||\"\",image:profile.picture,email:profile.preferred_username||null,emailVerified:false,...userMap},data:{...profile}}},options}},\"roblox\");0&&(module.exports={roblox});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,+IAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAG5B,MAAM,OAAS,OAAC,SAAY,CAC3B,MAAM,cAAgB,yCACtB,MAAO,CACN,GAAI,SACJ,KAAM,SACN,uBAAuB,CAAE,MAAO,OAAQ,WAAY,EAAG,CACtD,MAAM,QAAU,QAAQ,oBAAsB,CAAC,EAAI,CAAC,SAAU,SAAS,EACvE,GAAI,QAAQ,MAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,EAChD,GAAI,OAAQ,QAAQ,KAAK,GAAG,MAAM,EAClC,OAAO,IAAI,IAAI,oDAAoD,QAAQ,KAAK,GAAG,CAAC,iCAAiC,QAAQ,QAAQ,iBAAiB,mBAAmB,QAAQ,aAAe,WAAW,CAAC,UAAU,KAAK,WAAW,QAAQ,QAAU,wBAAwB,EAAE,CACnR,EACA,0BAA2B,aAAO,CAAE,KAAM,WAAY,IAAM,CAC3D,SAAO,8DAA0B,CAChC,KACA,YAAa,QAAQ,aAAe,YACpC,QACA,cACA,eAAgB,MACjB,CAAC,CACF,EAR2B,6BAS3B,mBAAoB,QAAQ,mBAAqB,QAAQ,mBAAqB,MAAO,cAAiB,C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