1.1.3 • Published 5 years ago

passport-mailru-email v1.1.3

Weekly downloads
30
License
MIT
Repository
github
Last release
5 years ago

passport-mailru-email

Passport strategy for authenticating form E-mail with Mail.ru using the OAuth 2.0 API.

Create app

Create an application and get clientID and clientSecret

Install

$ npm install passport-mailru-email

Usage

passport.use(new MailruStrategy({
    clientID: MAIL_APP_ID,
    clientSecret: MAIL_APP_SECRET,
    state: SERCRET_RANDOM_STRING,
    callbackURL: "http://localhost:3000/auth/mailru/callback"
  },
  function(accessToken, refreshToken, profile, cb) {
    User.findOrCreate({ mailId: profile.client_id }, function (err, user) {
      return cb(err, user);
    });
  }
));