Skip to content

Node.js based forum software built for the modern web

not requiring email any longer for user creation (regression -- closes julianlam/nodebb-plugin-sso-twitter#4)

Julian Lamee44128c8cf3
diff --git a/src/user/create.js b/src/user/create.js
index 73c333d27e..a1df21a8a4 100644
--- a/src/user/create.js
+++ b/src/user/create.js
@@ -21,7 +21,11 @@ module.exports = function(User) {
async.parallel([
function(next) {
- next(!utils.isEmailValid(userData.email) ? new Error('Invalid Email!') : null);
+ if (userData.email) {
+ next(!utils.isEmailValid(userData.email) ? new Error('Invalid Email!') : null);
+ } else {
+ next();
+ }
},
function(next) {
next((!utils.isUserNameValid(userData.username) || !userData.userslug) ? new Error('Invalid Username!') : null);