Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async (data: any, context: CallableContext) => {
if (context.auth == null) {
return notAuthenticatedResponse
}
chargebee.configure(getChargebeeOptions())
const portalOptions = {
redirect_url: data.redirectUrl,
customer: getUser(context),
}
return chargebee.portal_session
.create(portalOptions)
.request(resultFormatter(portalSession))
},
)
createPortalSession(user, cb) {
chargebee.portal_session.create({
redirect_url: REDIRECT_URL,
customer: {
id: user._id.toString()
}
}).request(cb);
}