Skip to content

Documentation updates #2

Open
Open
@keneasson

Description

@keneasson

In the Documentation the Strategy function should be: FitbitOAuth2Strategy, and scope doesn't work if passed in the use.authentication, but needs to be in the arguments passed to the constructor.

var FitbitStrategy = require( 'passport-fitbit-oauth2' ).Strategy;

passport.use(new FitbitStrategy({
    clientID:     FITBIT_CLIENT_ID,
    clientSecret: FITBIT_CLIENT_SECRET,
    callbackURL: "http://yourdormain:3000/auth/fitbit/callback"
  },

As a Module, this works with the current code base:

var FitbitStrategy = require( 'passport-fitbit-oauth2' ).FitbitOAuth2Strategy;
var config = require('./fitbit_oauth2.js').settings;
module.exports = function(passport) {
    passport.use(new FitbitStrategy({
            clientID:     config.clientID,
            clientSecret: config.clientSecret,
            scope: config.scope,
            callbackURL: config.callbackURL,
        },
        function(accessToken, refreshToken, profile, done) {
            User.findOrCreate({ fitbitId: profile.id }, function (err, user) {
                return done(err, user);
            });
        }
    ));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions