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

23 lines
539 B
JavaScript
Raw Normal View History

2012-11-16 16:43:12 +01:00
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);
});