Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hubspot/api-auth-lib

Package Overview
Dependencies
Maintainers
12
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hubspot/api-auth-lib - npm Package Compare versions

Comparing version 1.1.1 to 1.1.3-beta.0

18

OAuth2Manager.js

@@ -7,3 +7,9 @@ const express = require('express');

const { HubSpotAuthError } = require('./Errors');
const { ENVIRONMENTS } = require('@hubspot/cms-lib/lib/constants');
const { handleExit } = require('@hubspot/cms-lib/lib/process');
const {
getHubSpotWebsiteOrigin,
getHubSpotApiOrigin,
} = require('@hubspot/cms-lib/lib/urls');
const { getValidEnv } = require('@hubspot/cms-lib/lib/environment');

@@ -20,3 +26,3 @@ const PORT = 3000;

scopes,
environment = 'prod',
environment = ENVIRONMENTS.PROD,
tokenInfo = { expiresAt: null, refreshToken: null, accessToken: null },

@@ -32,3 +38,3 @@ },

this.portalId = portalId;
this.env = environment.toLowerCase() === 'prod' ? '' : 'qa';
this.env = getValidEnv(environment, true);
this.logger = logger;

@@ -41,3 +47,3 @@ this.writeTokenInfo = writeTokenInfo;

return (
`https://app.hubspot${this.env}.com/oauth/${this.portalId}/authorize` +
`${getHubSpotWebsiteOrigin(this.env)}/oauth/${this.portalId}/authorize` +
`?client_id=${encodeURIComponent(this.clientId)}` + // app's client ID

@@ -131,3 +137,3 @@ `&scope=${encodeURIComponent(this.scopes.join(' '))}` + // scopes being requested by the app

this.refreshTokenRequest = request.post(
`https://api.hubapi${this.env}.com/oauth/v1/token`,
`${getHubSpotApiOrigin(this.env)}/oauth/v1/token`,
{

@@ -197,3 +203,3 @@ form: exchangeProof,

return {
environment: this.env ? 'qa' : 'prod',
environment: this.env ? ENVIRONMENTS.QA : ENVIRONMENTS.PROD,
clientSecret: this.clientSecret,

@@ -212,3 +218,3 @@ clientId: this.clientId,

...rest,
environment: env && env.toLowerCase() === 'qa' ? 'qa' : 'prod',
environment: getValidEnv(env),
...auth,

@@ -215,0 +221,0 @@ },

{
"name": "@hubspot/api-auth-lib",
"version": "1.1.1",
"version": "1.1.3-beta.0",
"license": "Apache-2.0",

@@ -23,3 +23,3 @@ "main": "index.js",

},
"gitHead": "c0aac7dd9ec92e3ae28e0f4cb2820f8a5834a58f"
"gitHead": "6b6fd557ef9a25ad91065ccd3a2b0db1c3b3d267"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc