Edit: /tmp/tsx-0/17887-b060c54e1f49d5e814966c0eeec94642d2247b5c (5226B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/gitlab.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 gitlab_exports={};__export(gitlab_exports,{gitlab:()=>gitlab});module.exports=__toCommonJS(gitlab_exports);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_fetch=require(\"@better-fetch/fetch\");const cleanDoubleSlashes=__name((input=\"\")=>{return input.split(\"://\").map(str=>str.replace(/\\/{2,}/g,\"/\")).join(\"://\")},\"cleanDoubleSlashes\");const issuerToEndpoints=__name(issuer=>{const baseUrl=issuer||\"https://gitlab.com\";return{authorizationEndpoint:cleanDoubleSlashes(`${baseUrl}/oauth/authorize`),tokenEndpoint:cleanDoubleSlashes(`${baseUrl}/oauth/token`),userinfoEndpoint:cleanDoubleSlashes(`${baseUrl}/api/v4/user`)}},\"issuerToEndpoints\");const gitlab=__name(options=>{const{authorizationEndpoint,tokenEndpoint,userinfoEndpoint}=issuerToEndpoints(options.issuer);const issuerId=\"gitlab\";return{id:issuerId,name:\"Gitlab\",createAuthorizationURL:__name(async({state,scopes,codeVerifier,loginHint,redirectURI})=>{const _scopes=options.disableDefaultScope?[]:[\"read_user\"];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes);return await(0,import_create_authorization_url.createAuthorizationURL)({id:issuerId,options,authorizationEndpoint,scopes:_scopes,state,redirectURI,codeVerifier,loginHint})},\"createAuthorizationURL\"),validateAuthorizationCode:__name(async({code,redirectURI,codeVerifier})=>{return(0,import_validate_authorization_code.validateAuthorizationCode)({code,redirectURI,options,codeVerifier,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)(userinfoEndpoint,{headers:{authorization:`Bearer ${token.accessToken}`}});if(error||profile.state!==\"active\"||profile.locked)return null;const userMap=await options.mapProfileToUser?.(profile);return{user:{id:profile.id,name:profile.name??profile.username??\"\",email:profile.email,image:profile.avatar_url,emailVerified:profile.email_verified??false,...userMap},data:profile}},options}},\"gitlab\");0&&(module.exports={gitlab});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,mJAAuC,kDACvC,gCAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAG5B,MAAM,mBAAqB,QAAC,MAAQ,KAAO,CAC1C,OAAO,MAAM,MAAM,KAAK,EAAE,IAAK,KAAQ,IAAI,QAAQ,UAAW,GAAG,CAAC,EAAE,KAAK,KAAK,CAC/E,EAF2B,sBAG3B,MAAM,kBAAoB,OAAC,QAAW,CACrC,MAAM,QAAU,QAAU,qBAC1B,MAAO,CACN,sBAAuB,mBAAmB,GAAG,OAAO,kBAAkB,EACtE,cAAe,mBAAmB,GAAG,OAAO,c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AY,GAC1C,MAAO,QAAQ,MACf,MAAO,QAAQ,WACf,cAAe,QAAQ,gBAAkB,MACzC,GAAG,OACJ,EACA,KAAM,OACP,CACD,EACA,OACD,CACD,EA5De","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/gitlab.mjs"],"sourcesContent":[null]}}