{"action":"created","issue":{"url":"https://api.github.com/repos/larron/mongoose-email-address-manager/issues/10","labels_url":"https://api.github.com/repos/larron/mongoose-email-address-manager/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/larron/mongoose-email-address-manager/issues/10/comments","events_url":"https://api.github.com/repos/larron/mongoose-email-address-manager/issues/10/events","html_url":"https://github.com/larron/mongoose-email-address-manager/issues/10","id":101945301,"number":10,"title":"Preventing Reserved Email Addresses","user":{"login":"winduptoy","id":270504,"avatar_url":"https://avatars.githubusercontent.com/u/270504?v=3","gravatar_id":"","url":"https://api.github.com/users/winduptoy","html_url":"https://github.com/winduptoy","followers_url":"https://api.github.com/users/winduptoy/followers","following_url":"https://api.github.com/users/winduptoy/following{/other_user}","gists_url":"https://api.github.com/users/winduptoy/gists{/gist_id}","starred_url":"https://api.github.com/users/winduptoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/winduptoy/subscriptions","organizations_url":"https://api.github.com/users/winduptoy/orgs","repos_url":"https://api.github.com/users/winduptoy/repos","events_url":"https://api.github.com/users/winduptoy/events{/privacy}","received_events_url":"https://api.github.com/users/winduptoy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-19T16:52:57Z","updated_at":"2015-09-12T04:17:51Z","closed_at":null,"body":"Quick question regarding this system. How would I avoid the following conflict?\r\n\r\n**USER A:**\r\nEmail 1: john@example.com (valid, he owns it)\r\nEmail 2: mark@example.com (he does not own it)\r\n\r\n**USER B:**\r\nEmail 1: mark@example.com (valid, he owns it)\r\n\r\nIf User A signs up first and adds mark@example.com to his account (but doesn't verify), and then User B signs up with mark@example.com, then a query of `findOneByEmail` will return User A, leading us to believe that the email address has already been taken. Is there a recommended way of handling this scenario?"},"comment":{"url":"https://api.github.com/repos/larron/mongoose-email-address-manager/issues/comments/139711490","html_url":"https://github.com/larron/mongoose-email-address-manager/issues/10#issuecomment-139711490","issue_url":"https://api.github.com/repos/larron/mongoose-email-address-manager/issues/10","id":139711490,"user":{"login":"larron","id":1730829,"avatar_url":"https://avatars.githubusercontent.com/u/1730829?v=3","gravatar_id":"","url":"https://api.github.com/users/larron","html_url":"https://github.com/larron","followers_url":"https://api.github.com/users/larron/followers","following_url":"https://api.github.com/users/larron/following{/other_user}","gists_url":"https://api.github.com/users/larron/gists{/gist_id}","starred_url":"https://api.github.com/users/larron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larron/subscriptions","organizations_url":"https://api.github.com/users/larron/orgs","repos_url":"https://api.github.com/users/larron/repos","events_url":"https://api.github.com/users/larron/events{/privacy}","received_events_url":"https://api.github.com/users/larron/received_events","type":"User","site_admin":false},"created_at":"2015-09-12T04:17:51Z","updated_at":"2015-09-12T04:17:51Z","body":"@winduptoy Hey Matt, this scenario presents some interesting complications.  You would need to use the User.findByEmail and do some manual comparison to figure out what you wanted to do next.  Generally it's a better practice to disallow duplicate email addresses especially when you will use them for a login system.  It sucks for User B, but I'm sure he'd get along just fine with a different email."}}