passport-mailru-email
v1.1.3
Published
Mail.ru authentication strategy from E-mail for Passport.
Downloads
26
Maintainers
Readme
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);
});
}
));