From d9ea5977cd9cd596e81c4b9282512d04d8f22f1f Mon Sep 17 00:00:00 2001 From: gaba Date: Thu, 5 Jan 2017 18:24:05 -0300 Subject: [PATCH] Unique displayName for the User. --- models/user.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/user.js b/models/user.js index 7df713337..f4ddbd895 100644 --- a/models/user.js +++ b/models/user.js @@ -46,7 +46,11 @@ const UserSchema = new mongoose.Schema({ // This is sourced from the social provider or set manually during user setup // and simply provides a name to display for the given user. - displayName: String, + displayName: { + type: String, + unique: true, + required: true + }, // This is true when the user account is disabled, no action should be // acknowledged when they are disabled. Logins are also prevented.