Edit: /tmp/tsx-0/17887-2f1e674b3912b6d7b6cb3437a4d3c9d32d8d0f94 (5859B)
{"code":"__filename=\"/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/line.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 line_exports={};__export(line_exports,{line:()=>line});module.exports=__toCommonJS(line_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\");var import_jose=require(\"jose\");const line=__name(options=>{const authorizationEndpoint=\"https://access.line.me/oauth2/v2.1/authorize\";const tokenEndpoint=\"https://api.line.me/oauth2/v2.1/token\";const userInfoEndpoint=\"https://api.line.me/oauth2/v2.1/userinfo\";const verifyIdTokenEndpoint=\"https://api.line.me/oauth2/v2.1/verify\";return{id:\"line\",name:\"LINE\",async createAuthorizationURL({state,scopes,codeVerifier,redirectURI,loginHint}){const _scopes=options.disableDefaultScope?[]:[\"openid\",\"profile\",\"email\"];if(options.scope)_scopes.push(...options.scope);if(scopes)_scopes.push(...scopes);return await(0,import_create_authorization_url.createAuthorizationURL)({id:\"line\",options,authorizationEndpoint,scopes:_scopes,state,codeVerifier,redirectURI,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,clientSecret:options.clientSecret},tokenEndpoint})},async verifyIdToken(token,nonce){if(options.disableIdTokenSignIn)return false;if(options.verifyIdToken)return options.verifyIdToken(token,nonce);const body=new URLSearchParams;body.set(\"id_token\",token);body.set(\"client_id\",options.clientId);if(nonce)body.set(\"nonce\",nonce);const{data,error}=await(0,import_fetch.betterFetch)(verifyIdTokenEndpoint,{method:\"POST\",headers:{\"content-type\":\"application/x-www-form-urlencoded\"},body});if(error||!data)return false;if(data.aud!==options.clientId)return false;if(data.nonce&&data.nonce!==nonce)return false;return true},async getUserInfo(token){if(options.getUserInfo)return options.getUserInfo(token);let profile=null;if(token.idToken)try{profile=(0,import_jose.decodeJwt)(token.idToken)}catch{}if(!profile){const{data}=await(0,import_fetch.betterFetch)(userInfoEndpoint,{headers:{authorization:`Bearer ${token.accessToken}`}});profile=data||null}if(!profile)return null;const userMap=await options.mapProfileToUser?.(profile);const id=profile.sub||profile.userId;const name=profile.name||profile.displayName||\"\";const image=profile.picture||profile.pictureUrl||void 0;return{user:{id,name,email:profile.email,image,emailVerified:false,...userMap},data:profile}},options}},\"line\");0&&(module.exports={line});\n})()\n","warnings":[],"map":{"version":3,"mappings":";suBAAA,yIAAuC,kDACvC,gCAAmC,8CACnC,uCAA0C,qDAC1C,kBAAO,+BACP,iBAA4B,+BAC5B,gBAA0B,gBAY1B,MAAM,KAAO,OAAC,SAAY,CACzB,MAAM,sBAAwB,+CAC9B,MAAM,cAAgB,wCACtB,MAAM,iBAAmB,2CACzB,MAAM,sBAAwB,yCAC9B,MAAO,CACN,GAAI,OACJ,KAAM,OACN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MAAM,QAAS,GAAI,CACtB,WAAU,uBAAU,MAAM,OAAO,CAClC,MAAQ,CAAC,CACT,GAAI,CAAC,QAAS,CACb,KAAM,CAAE,IAAK,EAAI,QAAM,0BAAY,iBAAkB,CAAE,QAAS,CAAE,cAAe,UAAU,MAAM,WAAW,EAAG,CAAE,CAAC,EAClH,QAAU,MAAQ,IACnB,CACA,GAAI,CAAC,QAAS,OAAO,KACrB,MAAM,QAAU,MAAM,QAAQ,mBAAmB,OAAO,EACxD,MAAM,GAAK,QAAQ,KAAO,QAAQ,OAClC,MAAM,KAAO,QAAQ,MAAQ,QAAQ,aAAe,GACpD,MAAM,MAAQ,QAAQ,SAAW,QAAQ,YAAc,OACvD,MAAO,CACN,KAAM,CACL,GACA,KACA,MAAO,QAAQ,MACf,MACA,cAAe,MACf,GAAG,OACJ,EACA,KAAM,OACP,CACD,EACA,OACD,CACD,EA5Fa","names":[],"ignoreList":[],"sources":["/opt/canhelp/node_modules/better-auth/node_modules/@better-auth/core/dist/social-providers/line.mjs"],"sourcesContent":[null]}}