Skip to content

l0gd0g/passport-ucoz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

passport-ucoz

Install

$ npm install passport-ucoz

Authenticate Requests

Use passport.authenticate(), specifying the 'ucoz' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth/ucoz',
  passport.authenticate('ucoz'));

app.get('/auth/ucoz/callback', 
  passport.authenticate('ucoz', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

Examples

passport.use(new UcozStrategy({
    consumerKey: UCOZ_CONSUMER_KEY,
    consumerSecret: UCOZ_CONSUMER_SECRET,
    callbackURL: "http://127.0.0.1:3000/auth/ucoz/callback"
  },
  function(req, accessToken, tokenSecret, profile, done) {
    User.findOrCreate({ userId: profile.id }, function (err, user) {
      return done(err, user);
    });
  }
));

Tests

$ npm install
$ npm test

Credits

License

The MIT License

Copyright (c) 2015 Maxim Jarusov

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published