Skip to content

Instantly share code, notes, and snippets.

@mdz
Created February 10, 2012 02:25
Show Gist options
  • Select an option

  • Save mdz/1785708 to your computer and use it in GitHub Desktop.

Select an option

Save mdz/1785708 to your computer and use it in GitHub Desktop.
diff --git a/site/app/lib/auth.js b/site/app/lib/auth.js
index 637420b..a4d52b3 100644
--- a/site/app/lib/auth.js
+++ b/site/app/lib/auth.js
@@ -47,6 +47,10 @@ exports.createAccount = function(newUserAttributes, promise) {
user.name = name;
user.optin = optin;
accounts.findOne({$or:[{email:email}, {'locker.name':lockerName}]}, function(err, doc) {
+ if (err) {
+ promise.fulfill([err]);
+ return promise;
+ }
if (!doc) {
accounts.save(user, function(err, doc) {
if (err) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment