aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--controllers/users.js2
-rw-r--r--models/User.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/controllers/users.js b/controllers/users.js
index fbd2eb1..f3568a4 100644
--- a/controllers/users.js
+++ b/controllers/users.js
@@ -129,7 +129,7 @@ exports.postProjectParticipants = function(req, res) {
var newUser = new User();
newUser.email = mailAddress;
newUser.status = 1;
-
+ newUser.password = newUser.generateRandomToken(32);
newUser.save(function(err) {
if (err) return res.render('projectParticipants', { title: 'Nytt prosjekt - en feil oppstod', loggedin: true });
console.log('made new user ' + newUser._id);
diff --git a/models/User.js b/models/User.js
index b3a3f1e..37ad39f 100644
--- a/models/User.js
+++ b/models/User.js
@@ -74,7 +74,7 @@ UserSchema.path('username').validate(function(username) {
}, 'Username cannot be blank');
UserSchema.path('hashed_password').validate(function(hashed_password) {
- if(authTypes.indexOf(this.provider) !== -1 || this.status === 1) return true;
+ if(authTypes.indexOf(this.provider) !== -1) return true;
return hashed_password.length;
}, 'Password cannot be blank');