Edit: /tmp/tsx-0/17887-b710e35efe38a9eafb3baa6c45ae82697a561ee1 (4516B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/kakao.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 kakao_exports={};__export(kakao_exports,{kakao:()=>kakao});module.exports=__toCommonJS(kakao_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 kakao=__name(options=>{const tokenEndpoint=\"https://kauth.kakao.com/oauth/token\";return{id:\"kakao\",name:\"Kakao\",createAuthorizationURL({state,scopes,redirectURI}){const _scopes=options.disableDefaultScope?[]:[\"account_email\",\"profile_image\",\"profile_nickname\"];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes);return(0,import_create_authorization_url.createAuthorizationURL)({id:\"kakao\",options,authorizationEndpoint:\"https://kauth.kakao.com/oauth/authorize\",scopes:_scopes,state,redirectURI})},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://kapi.kakao.com/v2/user/me\",{headers:{Authorization:`Bearer ${token.accessToken}`}});if(error||!profile)return null;const userMap=await options.mapProfileToUser?.(profile);const account=profile.kakao_account||{};const kakaoProfile=account.profile||{};return{user:{id:String(profile.id),name:kakaoProfile.nickname||account.name||\"\",email:account.email,image:kakaoProfile.profile_image_url||kakaoProfile.thumbnail_image_url,emailVerified:!!account.is_email_valid&&!!account.is_email_verified,...userMap},data:profile}},options}},\"kakao\");0&&(module.exports={kakao});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,8IAAuC,kDACvC,gCAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAG5B,MAAM,MAAQ,OAAC,SAAY,CAC1B,MAAM,cAAgB,sCACtB,MAAO,CACN,GAAI,QACJ,KAAM,QACN,uBAAuB,CAAE,MAAO,OAAQ,WAAY,EAAG,CACtD,MAAM,QAAU,QAAQ,oBAAsB,CAAC,EAAI,CAClD,gBACA,gBACA,kBACD,EACA,GAAI,QAAQ,MAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,EAChD,GAAI,OAAQ,QAAQ,KAAK,GAAG,MAAM,EAClC,SAAO,wDAAuB,CAC7B,GAAI,QACJ,QACA,sBAAuB,0CACvB,OAAQ,QACR,MACA,WACD,CAAC,CACF,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,oCAAqC,CAAE,QAAS,CAAE,cAAe,UAAU,MAAM,WAAW,EAAG,CAAE,CAAC,EACrJ,GAAI,OAAS,CAAC,QAAS,OAAO,KAC9B,MAAM,QAAU,MAAM,QAAQ,mBAAmB,OAAO,EACxD,MAAM,QAAU,QAAQ,eAAiB,CAAC,EAC1C,MAAM,aAAe,QAAQ,SAAW,CAAC,EACzC,MAAO,CACN,KAAM,CACL,GAAI,OAAO,QAAQ,EAAE,EACrB,KAAM,aAAa,UAAY,QAAQ,MAAQ,GAC/C,MAAO,QAAQ,MACf,MAAO,aAAa,mBAAqB,aAAa,oBACtD,cAAe,CAAC,CAAC,QAAQ,gBAAkB,CAAC,CAAC,QAAQ,kBACrD,GAAG,OACJ,EACA,KAAM,OACP,CACD,EACA,OACD,CACD,EA9Dc","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/kakao.mjs"],"sourcesContent":[null]}}