Skip to content

Commit

Permalink
Updated user schema (provider field was not used)
Browse files Browse the repository at this point in the history
  • Loading branch information
sahat committed Feb 1, 2014
1 parent a7c0dd6 commit 03b3bb6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions models/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ var userSchema = new mongoose.Schema({
email: { type: String, unique: true },
password: String,

tokens: Array,
provider: String,
facebook: { type: String, unique: true, sparse: true },
twitter: { type: String, unique: true, sparse: true },
google: { type: String, unique: true, sparse: true },
github: { type: String, unique: true, sparse: true },
tokens: Array,

profile: {
name: { type: String, default: '' },
Expand All @@ -21,6 +20,10 @@ var userSchema = new mongoose.Schema({
}
});

/**
* Hash the password for security.
*/

userSchema.pre('save', function(next) {
var user = this;
var SALT_FACTOR = 5;
Expand Down

0 comments on commit 03b3bb6

Please sign in to comment.