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

fitbit-client-oauth2

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fitbit-client-oauth2 - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

2

package.json
{
"name": "fitbit-client-oauth2",
"version": "2.0.0",
"version": "2.0.1",
"description": "A fitbit client using OAuth 2.0 authentication.",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -11,3 +11,3 @@ var Promise = require('promise');

return this.oauth2.accessToken.create(tokenObj);
return this.oauth2_token.accessToken.create(tokenObj);
};

@@ -31,3 +31,3 @@

var authCode = this.oauth2.authCode;
var authCode = this.oauth2_token.authCode;
var _this = this;

@@ -34,0 +34,0 @@ return new Promise(function(resolve, reject) {

@@ -29,2 +29,11 @@ var oauth2 = require('simple-oauth2');

this.oauth2_token = oauth2({
clientID: clientId,
clientSecret: consumerSecret,
site: config.FITBIT_BASE_API_URL_TOKEN,
authorizationPath: config.FITBIT_AUTH_PATH,
tokenPath: config.FITBIT_TOKEN_PATH,
useBasicAuthorizationHeader: true
});
this.redirect_uri = options.redirect_uri;

@@ -31,0 +40,0 @@ this.scope = options.scope || config.FITBIT_DEFAULT_SCOPE;

@@ -1,2 +0,3 @@

const FITBIT_BASE_API_URL = 'https://api.fitbit.com';
const FITBIT_BASE_API_URL = 'https://fitbit.com';
const FITBIT_BASE_API_URL_TOKEN = 'https://api.fitbit.com';
const FITBIT_AUTH_PATH = '/oauth2/authorize';

@@ -10,3 +11,4 @@ const FITBIT_TOKEN_PATH = '/oauth2/token';

FITBIT_TOKEN_PATH: FITBIT_TOKEN_PATH,
FITBIT_DEFAULT_SCOPE: FITBIT_DEFAULT_SCOPE
FITBIT_DEFAULT_SCOPE: FITBIT_DEFAULT_SCOPE,
FITBIT_BASE_API_URL_TOKEN: FITBIT_BASE_API_URL_TOKEN
};

@@ -18,3 +18,3 @@ var expect = require('chai').expect;

var authorization_uri = client.getAuthorizationUrl();
var final_url = 'https://api.fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fredirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&response_type=code&client_id=clientId_1234';
var final_url = 'https://fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fredirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&response_type=code&client_id=clientId_1234';

@@ -27,3 +27,3 @@ expect(authorization_uri).to.eql(final_url);

var authorization_uri = client.getAuthorizationUrl(redirect_uri);
var final_url = 'https://api.fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fdifferent_redirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&response_type=code&client_id=clientId_1234';
var final_url = 'https://fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fdifferent_redirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&response_type=code&client_id=clientId_1234';

@@ -38,3 +38,3 @@ expect(authorization_uri).to.eql(final_url);

var authorization_uri = client.getAuthorizationUrl(redirect_uri, scope);
var final_url = 'https://api.fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fdifferent_redirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&scope=heartrate&response_type=code&client_id=clientId_1234';
var final_url = 'https://fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fdifferent_redirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&scope=heartrate&response_type=code&client_id=clientId_1234';

@@ -50,3 +50,3 @@ expect(authorization_uri).to.eql(final_url);

var authorization_uri = client.getAuthorizationUrl(redirect_uri, scope, state);
var final_url = 'https://api.fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fdifferent_redirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&scope=heartrate&scope=heartrate&state=KEEP_THIS_STATE&response_type=code&client_id=clientId_1234';
var final_url = 'https://fitbit.com/oauth2/authorize?redirect_uri=http%3A%2F%2Fdifferent_redirect_uri&scope=activity&scope=nutrition&scope=profile&scope=settings&scope=sleep&scope=social&scope=weight&scope=heartrate&scope=heartrate&state=KEEP_THIS_STATE&response_type=code&client_id=clientId_1234';

@@ -53,0 +53,0 @@ expect(authorization_uri).to.eql(final_url);

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