dileephell

Untitled

Feb 3rd, 2014
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. module.exports.create_account = function(accountParms, cb)
  2. {
  3. console.log(accountParms);
  4. db.Account.findOne({'username' : accountParms.username}, function( err, user) {
  5. if(err) { cb(false, err, null); }
  6. if(user == null)
  7. {
  8. create_user(accountParms.email, accountParms.password, accountParms.nick, cb);
  9. }
  10. if(user != null && user.verified)
  11. {
  12. cb('Username in use!!', null);
  13. }
  14. else if(user != null && !user.verified)
  15. {
  16. cb('Please verified Yourself');
  17. }
  18.  
  19. });
  20.  
  21. }
  22.  
  23. need more conditions of logic for login
Advertisement
Add Comment
Please, Sign In to add comment