Skip to content

Instantly share code, notes, and snippets.

@biagidp
Created September 6, 2016 18:56
Show Gist options
  • Save biagidp/c2cb6963546de559a9f289199d44424c to your computer and use it in GitHub Desktop.
Save biagidp/c2cb6963546de559a9f289199d44424c to your computer and use it in GitHub Desktop.
logic.FindMatchingUser = function(NewUser, ExistingUsers, callback)
{
//campare email to see if same user or not
console.log("Comparing");
console.log(ExistingUsers);
//make sure this handles multiple possible matches\
//for each
for(var i = 0; i < ExistingUsers.length; i++)
{
var user = ExistingUsers[i];
console.log(user.EmailAddress + "\n" + NewUser.EmailAddress);
if(NewUser.EmailAddress === user.EmailAddress)
{
console.log(user);
callback(user);
}
}
callback();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment