fitbit-client-oauth2
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"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); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
20586
408
0