{"action":"created","comment":{"url":"https://api.github.com/repos/oaeproject/Hilary/pulls/comments/41745386","id":41745386,"diff_hunk":"@@ -307,12 +308,19 @@ var _getOrCreateUser = function(ctx, loginId, displayName, opts, callback) {\n                     opts.emailVerified = true;\n                 }\n \n-                createUser(ctx, loginId, displayName, opts, function(err, user) {\n+                var shouldCheckEmail = (opts.email && !opts.authoritative);\n+                OaeUtil.invokeIfNecessary(shouldCheckEmail, validateEmailBelongsToTenant, ctx, opts.email, function(err) {","path":"node_modules/oae-authentication/lib/api.js","position":14,"original_position":14,"commit_id":"60c1e8c061602b8a614b93f7dc5f133305cdf325","original_commit_id":"60c1e8c061602b8a614b93f7dc5f133305cdf325","user":{"login":"simong","id":92180,"avatar_url":"https://avatars.githubusercontent.com/u/92180?v=3","gravatar_id":"","url":"https://api.github.com/users/simong","html_url":"https://github.com/simong","followers_url":"https://api.github.com/users/simong/followers","following_url":"https://api.github.com/users/simong/following{/other_user}","gists_url":"https://api.github.com/users/simong/gists{/gist_id}","starred_url":"https://api.github.com/users/simong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simong/subscriptions","organizations_url":"https://api.github.com/users/simong/orgs","repos_url":"https://api.github.com/users/simong/repos","events_url":"https://api.github.com/users/simong/events{/privacy}","received_events_url":"https://api.github.com/users/simong/received_events","type":"User","site_admin":false},"body":"What should we do in that case? Block the user from creating an account? ","created_at":"2015-10-12T11:03:06Z","updated_at":"2015-10-12T11:03:06Z","html_url":"https://github.com/oaeproject/Hilary/pull/1241#discussion_r41745386","pull_request_url":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241","_links":{"self":{"href":"https://api.github.com/repos/oaeproject/Hilary/pulls/comments/41745386"},"html":{"href":"https://github.com/oaeproject/Hilary/pull/1241#discussion_r41745386"},"pull_request":{"href":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241"}}},"pull_request":{"url":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241","id":46704985,"html_url":"https://github.com/oaeproject/Hilary/pull/1241","diff_url":"https://github.com/oaeproject/Hilary/pull/1241.diff","patch_url":"https://github.com/oaeproject/Hilary/pull/1241.patch","issue_url":"https://api.github.com/repos/oaeproject/Hilary/issues/1241","number":1241,"state":"open","locked":false,"title":"Only allow local account creation with configured email domain","user":{"login":"simong","id":92180,"avatar_url":"https://avatars.githubusercontent.com/u/92180?v=3","gravatar_id":"","url":"https://api.github.com/users/simong","html_url":"https://github.com/simong","followers_url":"https://api.github.com/users/simong/followers","following_url":"https://api.github.com/users/simong/following{/other_user}","gists_url":"https://api.github.com/users/simong/gists{/gist_id}","starred_url":"https://api.github.com/users/simong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simong/subscriptions","organizations_url":"https://api.github.com/users/simong/orgs","repos_url":"https://api.github.com/users/simong/repos","events_url":"https://api.github.com/users/simong/events{/privacy}","received_events_url":"https://api.github.com/users/simong/received_events","type":"User","site_admin":false},"body":"When a tenant is configured with an email domain, it should only allow local account creation with that configured email domain.","created_at":"2015-10-03T12:37:16Z","updated_at":"2015-10-12T11:03:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4422014fec167e94a8a3472edc46a5c48c987767","assignee":{"login":"simong","id":92180,"avatar_url":"https://avatars.githubusercontent.com/u/92180?v=3","gravatar_id":"","url":"https://api.github.com/users/simong","html_url":"https://github.com/simong","followers_url":"https://api.github.com/users/simong/followers","following_url":"https://api.github.com/users/simong/following{/other_user}","gists_url":"https://api.github.com/users/simong/gists{/gist_id}","starred_url":"https://api.github.com/users/simong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simong/subscriptions","organizations_url":"https://api.github.com/users/simong/orgs","repos_url":"https://api.github.com/users/simong/repos","events_url":"https://api.github.com/users/simong/events{/privacy}","received_events_url":"https://api.github.com/users/simong/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241/commits","review_comments_url":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241/comments","review_comment_url":"https://api.github.com/repos/oaeproject/Hilary/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oaeproject/Hilary/issues/1241/comments","statuses_url":"https://api.github.com/repos/oaeproject/Hilary/statuses/60c1e8c061602b8a614b93f7dc5f133305cdf325","head":{"label":"simong:1241-email-domain-create-account","ref":"1241-email-domain-create-account","sha":"60c1e8c061602b8a614b93f7dc5f133305cdf325","user":{"login":"simong","id":92180,"avatar_url":"https://avatars.githubusercontent.com/u/92180?v=3","gravatar_id":"","url":"https://api.github.com/users/simong","html_url":"https://github.com/simong","followers_url":"https://api.github.com/users/simong/followers","following_url":"https://api.github.com/users/simong/following{/other_user}","gists_url":"https://api.github.com/users/simong/gists{/gist_id}","starred_url":"https://api.github.com/users/simong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simong/subscriptions","organizations_url":"https://api.github.com/users/simong/orgs","repos_url":"https://api.github.com/users/simong/repos","events_url":"https://api.github.com/users/simong/events{/privacy}","received_events_url":"https://api.github.com/users/simong/received_events","type":"User","site_admin":false},"repo":{"id":5638617,"name":"Hilary","full_name":"simong/Hilary","owner":{"login":"simong","id":92180,"avatar_url":"https://avatars.githubusercontent.com/u/92180?v=3","gravatar_id":"","url":"https://api.github.com/users/simong","html_url":"https://github.com/simong","followers_url":"https://api.github.com/users/simong/followers","following_url":"https://api.github.com/users/simong/following{/other_user}","gists_url":"https://api.github.com/users/simong/gists{/gist_id}","starred_url":"https://api.github.com/users/simong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simong/subscriptions","organizations_url":"https://api.github.com/users/simong/orgs","repos_url":"https://api.github.com/users/simong/repos","events_url":"https://api.github.com/users/simong/events{/privacy}","received_events_url":"https://api.github.com/users/simong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/simong/Hilary","description":"","fork":true,"url":"https://api.github.com/repos/simong/Hilary","forks_url":"https://api.github.com/repos/simong/Hilary/forks","keys_url":"https://api.github.com/repos/simong/Hilary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simong/Hilary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simong/Hilary/teams","hooks_url":"https://api.github.com/repos/simong/Hilary/hooks","issue_events_url":"https://api.github.com/repos/simong/Hilary/issues/events{/number}","events_url":"https://api.github.com/repos/simong/Hilary/events","assignees_url":"https://api.github.com/repos/simong/Hilary/assignees{/user}","branches_url":"https://api.github.com/repos/simong/Hilary/branches{/branch}","tags_url":"https://api.github.com/repos/simong/Hilary/tags","blobs_url":"https://api.github.com/repos/simong/Hilary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simong/Hilary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simong/Hilary/git/refs{/sha}","trees_url":"https://api.github.com/repos/simong/Hilary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simong/Hilary/statuses/{sha}","languages_url":"https://api.github.com/repos/simong/Hilary/languages","stargazers_url":"https://api.github.com/repos/simong/Hilary/stargazers","contributors_url":"https://api.github.com/repos/simong/Hilary/contributors","subscribers_url":"https://api.github.com/repos/simong/Hilary/subscribers","subscription_url":"https://api.github.com/repos/simong/Hilary/subscription","commits_url":"https://api.github.com/repos/simong/Hilary/commits{/sha}","git_commits_url":"https://api.github.com/repos/simong/Hilary/git/commits{/sha}","comments_url":"https://api.github.com/repos/simong/Hilary/comments{/number}","issue_comment_url":"https://api.github.com/repos/simong/Hilary/issues/comments{/number}","contents_url":"https://api.github.com/repos/simong/Hilary/contents/{+path}","compare_url":"https://api.github.com/repos/simong/Hilary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simong/Hilary/merges","archive_url":"https://api.github.com/repos/simong/Hilary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simong/Hilary/downloads","issues_url":"https://api.github.com/repos/simong/Hilary/issues{/number}","pulls_url":"https://api.github.com/repos/simong/Hilary/pulls{/number}","milestones_url":"https://api.github.com/repos/simong/Hilary/milestones{/number}","notifications_url":"https://api.github.com/repos/simong/Hilary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simong/Hilary/labels{/name}","releases_url":"https://api.github.com/repos/simong/Hilary/releases{/id}","created_at":"2012-09-01T10:17:52Z","updated_at":"2015-05-06T10:09:10Z","pushed_at":"2015-10-06T09:48:48Z","git_url":"git://github.com/simong/Hilary.git","ssh_url":"git@github.com:simong/Hilary.git","clone_url":"https://github.com/simong/Hilary.git","svn_url":"https://github.com/simong/Hilary","homepage":null,"size":26525,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"oaeproject:master","ref":"master","sha":"0cf10afc381176e7befed7c6b204e45d6edd4083","user":{"login":"oaeproject","id":4659912,"avatar_url":"https://avatars.githubusercontent.com/u/4659912?v=3","gravatar_id":"","url":"https://api.github.com/users/oaeproject","html_url":"https://github.com/oaeproject","followers_url":"https://api.github.com/users/oaeproject/followers","following_url":"https://api.github.com/users/oaeproject/following{/other_user}","gists_url":"https://api.github.com/users/oaeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/oaeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oaeproject/subscriptions","organizations_url":"https://api.github.com/users/oaeproject/orgs","repos_url":"https://api.github.com/users/oaeproject/repos","events_url":"https://api.github.com/users/oaeproject/events{/privacy}","received_events_url":"https://api.github.com/users/oaeproject/received_events","type":"Organization","site_admin":false},"repo":{"id":5638565,"name":"Hilary","full_name":"oaeproject/Hilary","owner":{"login":"oaeproject","id":4659912,"avatar_url":"https://avatars.githubusercontent.com/u/4659912?v=3","gravatar_id":"","url":"https://api.github.com/users/oaeproject","html_url":"https://github.com/oaeproject","followers_url":"https://api.github.com/users/oaeproject/followers","following_url":"https://api.github.com/users/oaeproject/following{/other_user}","gists_url":"https://api.github.com/users/oaeproject/gists{/gist_id}","starred_url":"https://api.github.com/users/oaeproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oaeproject/subscriptions","organizations_url":"https://api.github.com/users/oaeproject/orgs","repos_url":"https://api.github.com/users/oaeproject/repos","events_url":"https://api.github.com/users/oaeproject/events{/privacy}","received_events_url":"https://api.github.com/users/oaeproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/oaeproject/Hilary","description":"Open Academic Environment (OAE) Back-End","fork":false,"url":"https://api.github.com/repos/oaeproject/Hilary","forks_url":"https://api.github.com/repos/oaeproject/Hilary/forks","keys_url":"https://api.github.com/repos/oaeproject/Hilary/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oaeproject/Hilary/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oaeproject/Hilary/teams","hooks_url":"https://api.github.com/repos/oaeproject/Hilary/hooks","issue_events_url":"https://api.github.com/repos/oaeproject/Hilary/issues/events{/number}","events_url":"https://api.github.com/repos/oaeproject/Hilary/events","assignees_url":"https://api.github.com/repos/oaeproject/Hilary/assignees{/user}","branches_url":"https://api.github.com/repos/oaeproject/Hilary/branches{/branch}","tags_url":"https://api.github.com/repos/oaeproject/Hilary/tags","blobs_url":"https://api.github.com/repos/oaeproject/Hilary/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oaeproject/Hilary/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oaeproject/Hilary/git/refs{/sha}","trees_url":"https://api.github.com/repos/oaeproject/Hilary/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oaeproject/Hilary/statuses/{sha}","languages_url":"https://api.github.com/repos/oaeproject/Hilary/languages","stargazers_url":"https://api.github.com/repos/oaeproject/Hilary/stargazers","contributors_url":"https://api.github.com/repos/oaeproject/Hilary/contributors","subscribers_url":"https://api.github.com/repos/oaeproject/Hilary/subscribers","subscription_url":"https://api.github.com/repos/oaeproject/Hilary/subscription","commits_url":"https://api.github.com/repos/oaeproject/Hilary/commits{/sha}","git_commits_url":"https://api.github.com/repos/oaeproject/Hilary/git/commits{/sha}","comments_url":"https://api.github.com/repos/oaeproject/Hilary/comments{/number}","issue_comment_url":"https://api.github.com/repos/oaeproject/Hilary/issues/comments{/number}","contents_url":"https://api.github.com/repos/oaeproject/Hilary/contents/{+path}","compare_url":"https://api.github.com/repos/oaeproject/Hilary/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oaeproject/Hilary/merges","archive_url":"https://api.github.com/repos/oaeproject/Hilary/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oaeproject/Hilary/downloads","issues_url":"https://api.github.com/repos/oaeproject/Hilary/issues{/number}","pulls_url":"https://api.github.com/repos/oaeproject/Hilary/pulls{/number}","milestones_url":"https://api.github.com/repos/oaeproject/Hilary/milestones{/number}","notifications_url":"https://api.github.com/repos/oaeproject/Hilary/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oaeproject/Hilary/labels{/name}","releases_url":"https://api.github.com/repos/oaeproject/Hilary/releases{/id}","created_at":"2012-09-01T10:05:13Z","updated_at":"2015-09-09T11:50:05Z","pushed_at":"2015-10-08T15:43:04Z","git_url":"git://github.com/oaeproject/Hilary.git","ssh_url":"git@github.com:oaeproject/Hilary.git","clone_url":"https://github.com/oaeproject/Hilary.git","svn_url":"https://github.com/oaeproject/Hilary","homepage":"http://www.oaeproject.org","size":31312,"stargazers_count":35,"watchers_count":35,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":65,"mirror_url":null,"open_issues_count":36,"forks":65,"open_issues":36,"watchers":35,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241"},"html":{"href":"https://github.com/oaeproject/Hilary/pull/1241"},"issue":{"href":"https://api.github.com/repos/oaeproject/Hilary/issues/1241"},"comments":{"href":"https://api.github.com/repos/oaeproject/Hilary/issues/1241/comments"},"review_comments":{"href":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241/comments"},"review_comment":{"href":"https://api.github.com/repos/oaeproject/Hilary/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oaeproject/Hilary/pulls/1241/commits"},"statuses":{"href":"https://api.github.com/repos/oaeproject/Hilary/statuses/60c1e8c061602b8a614b93f7dc5f133305cdf325"}}}}