Skip to content

welcomeadam/passport-mailru-email

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published