Skip to content

Instantly share code, notes, and snippets.

@bookercodes
Created June 30, 2015 16:47
Show Gist options
  • Save bookercodes/e89b79d95351b240842b to your computer and use it in GitHub Desktop.
Save bookercodes/e89b79d95351b240842b to your computer and use it in GitHub Desktop.
var mongoose = require("mongoose");
var passport = require("passport-local-mongoose");
var user = new mongoose.Schema({
username: { type: String, required: true, unique: true },
email: { type: String, required: true, unique: true },
bio: { type: String, default: "This user has no bio." },
password_reset_code: String,
password_reset_time: Number,
activation_code : String,
validated: Boolean
});
user.plugin(passport, {
hashField: "password"
});
module.exports = mongoose.model("user", user);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment