diff --git a/models/User.js b/models/User.js index 8733d9b84d..2d862c3271 100644 --- a/models/User.js +++ b/models/User.js @@ -4,7 +4,7 @@ var mongoose = require('mongoose'), var userSchema = new mongoose.Schema({ // Local authentication - username: { type: String, index: true, unique: true }, + username: { type: String, unique: true, sparse: true }, password: String, // OAuth 2.0 authentication