mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-03-03 23:01:25 -05:00
Sparse indexing on username field to prevent duplicate null username error
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user