passport-mailru-email

1.1.3 • Public • Published

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);
    });
  }
));

Package Sidebar

Install

npm i passport-mailru-email

Weekly Downloads

15

Version

1.1.3

License

MIT

Unpacked Size

7.93 kB

Total Files

7

Last publish

Collaborators

  • a79313740346