Added gender to user schema and radio buttons to account page

This commit is contained in:
Sahat Yalkabov
2013-12-06 00:18:39 -05:00
parent 9c389c1afb
commit ce3a8c78ec
4 changed files with 17 additions and 9 deletions

View File

@@ -126,17 +126,15 @@ passport.use(new GoogleStrategy({
if (existingUser) {
return done(null, existingUser);
}
console.log(profile);
var user = new User({
name: profile.displayName,
email: profile._json.email,
gender: profile._json.gender,
picture: profile._json.picture,
provider: profile.provider
google: profile.id
});
user.tokens.google = accessToken;
user[profile.provider] = profile.id;
user.profile.name = profile.displayName;
user.profile.email = profile._json.email;
user.profile.gender = profile._json.gender;
user.profile.picture = profile._json.picture;
user.save(function(err) {
done(err, user);