Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    passport-offlinepublic

    passport-offline

    passport-offline is an authentication strategy for PassportJS that I developed for a project that I was working on that required Twitter authentication. Whilst Twitter auth is useful, it made life very difficult when developing the app whilst offline, and so passport-offline was born.

    Examples

    There's only one example, as the provider is really simple. Whatever you pass into the first parameter as an object, you'll get back as the user's profile object. It's as simple as that.

    passport.use(new OfflineStrategy({
        "profile": {
          id: 1234,
          username: 'mheap' 
        }
      },
      function(user, done) {
        User.findOrCreate(profile, function (err, user) {
          done(err, user);
        });
      }
    ));

    Keywords

    none

    install

    npm i passport-offline

    Downloadsweekly downloads

    2

    version

    0.1.0

    license

    none

    repository

    github.com

    last publish

    collaborators

    • avatar