passport-vk-app-sign
v0.1.1
Published
Vkontakte applications authentication strategy for Passport
Downloads
3
Maintainers
Readme
passport-vk-app-sign
Passport strategy for authenticating VK applications.
Install
$ npm install passport-vk-app-sign
Usage
passport.use(new VkAppSignStrategy({
secret: 'FgTxNdMzp7dgj2NPnEPv',
verbose: true,
},
function(signedParams, req, done) {
User.findOne({ userId: signedParams.viewer_id }, function (err, user) {
if (err) { return done(err); }
if (!user) { return done(null, false); }
if (!user.verifyPassword(password)) { return done(null, false); }
return done(null, user);
});
}
));