Skip to content

Instantly share code, notes, and snippets.

@devsignite
Created August 2, 2013 21:57
Show Gist options
  • Save devsignite/6143787 to your computer and use it in GitHub Desktop.
Save devsignite/6143787 to your computer and use it in GitHub Desktop.
User definition
var UserSchema = new Schema({
username: { type: String, required: true, trim: true, unique: true },
password: { type: String, required: true },
email: { type: String, lowercase: true, trim: true, unique: true },
salt: { type: String, required: true },
hash: { type: String, required: true },
verificationToken: { type: String },
verificationTokenExpirationDate: { type: Date },
isConfirmed: { type: Boolean, default: false },
confirmed: { type: Boolean, default: false },
confirmationToken: { type: String },
createdDate: { type: Date, default: Date.now },
changedDate: { type: Date },
lastPasswordFailureDate: { type: Date }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment