This repository has been archived on 2024-11-11. You can view files and clone it, but cannot push or open issues or pull requests.
socketio-jwt/test/fixture/setupPassport.js
2012-11-16 12:43:12 -03:00

23 lines
539 B
JavaScript

var passport = require('passport'),
LocalStrategy = require('passport-local').Strategy;
passport.use(new LocalStrategy(
function(username, password, done) {
if(username === 'jose' && password === 'Pa123'){
return done(null, {
name: 'jose',
mail: 'j@f.r'
});
} else {
return done(null, false, {message: 'wrong user name or password'});
}
}
));
passport.serializeUser(function(user, done) {
done(null, user);
});
passport.deserializeUser(function(user, done) {
done(null, user);
});