{"action":"created","comment":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments/54494041","id":54494041,"diff_hunk":"@@ -22,16 +22,74 @@ export class Config {\n     this.facebookAppIds = cacheInfo.facebookAppIds;\n     this.enableAnonymousUsers = cacheInfo.enableAnonymousUsers;\n     this.allowClientClassCreation = cacheInfo.allowClientClassCreation;\n-    this.database = DatabaseAdapter.getDatabaseConnection(applicationId, cacheInfo.collectionPrefix);\n+    this.database = DatabaseAdapter.getDatabaseConnection(applicationId, this.collectionPrefix);\n+    \n+    this.serverURL = cacheInfo.serverURL;\n+    this.publicServerURL = cacheInfo.publicServerURL;\n+    this.verifyUserEmails = cacheInfo.verifyUserEmails;\n+    this.appName = cacheInfo.appName;\n+\n     this.hooksController = cacheInfo.hooksController;\n     this.filesController = cacheInfo.filesController;\n-    this.pushController = cacheInfo.pushController;   \n+    this.pushController = cacheInfo.pushController;\n     this.loggerController = cacheInfo.loggerController;\n+    this.userController = cacheInfo.userController;\n     this.oauth = cacheInfo.oauth;\n-\n+    this.customPages = cacheInfo.customPages || {};\n     this.mount = mount;\n   }\n-}\n+  \n+  static validate(options) {\n+    this.validateEmailConfiguration({verifyUserEmails: options.verifyUserEmails, \n+                                appName: options.appName, \n+                                publicServerURL: options.publicServerURL})\n+  }\n+  \n+  static validateEmailConfiguration({verifyUserEmails, appName, publicServerURL}) {\n+    if (verifyUserEmails) {\n+      if (typeof appName !== 'string') {\n+        throw 'An app name is required when using email verification.';\n+      }\n+      if (!process.env.TESTING && typeof publicServerURL !== 'string') {\n+        if (process.env.NODE_ENV === 'production') {","path":"src/Config.js","position":37,"original_position":37,"commit_id":"284468d7fee5b06c62a023b836b1cb28cde98c82","original_commit_id":"284468d7fee5b06c62a023b836b1cb28cde98c82","user":{"login":"drew-gross","id":558242,"avatar_url":"https://avatars.githubusercontent.com/u/558242?v=3","gravatar_id":"","url":"https://api.github.com/users/drew-gross","html_url":"https://github.com/drew-gross","followers_url":"https://api.github.com/users/drew-gross/followers","following_url":"https://api.github.com/users/drew-gross/following{/other_user}","gists_url":"https://api.github.com/users/drew-gross/gists{/gist_id}","starred_url":"https://api.github.com/users/drew-gross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drew-gross/subscriptions","organizations_url":"https://api.github.com/users/drew-gross/orgs","repos_url":"https://api.github.com/users/drew-gross/repos","events_url":"https://api.github.com/users/drew-gross/events{/privacy}","received_events_url":"https://api.github.com/users/drew-gross/received_events","type":"User","site_admin":false},"body":"You definitely should not be throwing in production and warning in development. Just throw always. People can set their server URL to anything they want in dev just to make sure the emails are getting sent (localhost, example.com, even their actual public server URL :p)","created_at":"2016-02-29T22:53:25Z","updated_at":"2016-02-29T22:53:25Z","html_url":"https://github.com/ParsePlatform/parse-server/pull/627#discussion_r54494041","pull_request_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627","_links":{"self":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments/54494041"},"html":{"href":"https://github.com/ParsePlatform/parse-server/pull/627#discussion_r54494041"},"pull_request":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627"}}},"pull_request":{"url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627","id":60522349,"html_url":"https://github.com/ParsePlatform/parse-server/pull/627","diff_url":"https://github.com/ParsePlatform/parse-server/pull/627.diff","patch_url":"https://github.com/ParsePlatform/parse-server/pull/627.patch","issue_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/627","number":627,"state":"open","locked":false,"title":"Email Validation","user":{"login":"flovilmart","id":364568,"avatar_url":"https://avatars.githubusercontent.com/u/364568?v=3","gravatar_id":"","url":"https://api.github.com/users/flovilmart","html_url":"https://github.com/flovilmart","followers_url":"https://api.github.com/users/flovilmart/followers","following_url":"https://api.github.com/users/flovilmart/following{/other_user}","gists_url":"https://api.github.com/users/flovilmart/gists{/gist_id}","starred_url":"https://api.github.com/users/flovilmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flovilmart/subscriptions","organizations_url":"https://api.github.com/users/flovilmart/orgs","repos_url":"https://api.github.com/users/flovilmart/repos","events_url":"https://api.github.com/users/flovilmart/events{/privacy}","received_events_url":"https://api.github.com/users/flovilmart/received_events","type":"User","site_admin":false},"body":"From #583 ","created_at":"2016-02-24T15:06:13Z","updated_at":"2016-02-29T22:53:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"75d754d0dca3e53f5210049e91e26d48b3c20202","assignee":{"login":"drew-gross","id":558242,"avatar_url":"https://avatars.githubusercontent.com/u/558242?v=3","gravatar_id":"","url":"https://api.github.com/users/drew-gross","html_url":"https://github.com/drew-gross","followers_url":"https://api.github.com/users/drew-gross/followers","following_url":"https://api.github.com/users/drew-gross/following{/other_user}","gists_url":"https://api.github.com/users/drew-gross/gists{/gist_id}","starred_url":"https://api.github.com/users/drew-gross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drew-gross/subscriptions","organizations_url":"https://api.github.com/users/drew-gross/orgs","repos_url":"https://api.github.com/users/drew-gross/repos","events_url":"https://api.github.com/users/drew-gross/events{/privacy}","received_events_url":"https://api.github.com/users/drew-gross/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627/commits","review_comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627/comments","review_comment_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/627/comments","statuses_url":"https://api.github.com/repos/ParsePlatform/parse-server/statuses/284468d7fee5b06c62a023b836b1cb28cde98c82","head":{"label":"flovilmart:mail-adapter","ref":"mail-adapter","sha":"284468d7fee5b06c62a023b836b1cb28cde98c82","user":{"login":"flovilmart","id":364568,"avatar_url":"https://avatars.githubusercontent.com/u/364568?v=3","gravatar_id":"","url":"https://api.github.com/users/flovilmart","html_url":"https://github.com/flovilmart","followers_url":"https://api.github.com/users/flovilmart/followers","following_url":"https://api.github.com/users/flovilmart/following{/other_user}","gists_url":"https://api.github.com/users/flovilmart/gists{/gist_id}","starred_url":"https://api.github.com/users/flovilmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flovilmart/subscriptions","organizations_url":"https://api.github.com/users/flovilmart/orgs","repos_url":"https://api.github.com/users/flovilmart/repos","events_url":"https://api.github.com/users/flovilmart/events{/privacy}","received_events_url":"https://api.github.com/users/flovilmart/received_events","type":"User","site_admin":false},"repo":{"id":51014025,"name":"parse-server","full_name":"flovilmart/parse-server","owner":{"login":"flovilmart","id":364568,"avatar_url":"https://avatars.githubusercontent.com/u/364568?v=3","gravatar_id":"","url":"https://api.github.com/users/flovilmart","html_url":"https://github.com/flovilmart","followers_url":"https://api.github.com/users/flovilmart/followers","following_url":"https://api.github.com/users/flovilmart/following{/other_user}","gists_url":"https://api.github.com/users/flovilmart/gists{/gist_id}","starred_url":"https://api.github.com/users/flovilmart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flovilmart/subscriptions","organizations_url":"https://api.github.com/users/flovilmart/orgs","repos_url":"https://api.github.com/users/flovilmart/repos","events_url":"https://api.github.com/users/flovilmart/events{/privacy}","received_events_url":"https://api.github.com/users/flovilmart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flovilmart/parse-server","description":"Parse-compatible API server module for Node/Express","fork":true,"url":"https://api.github.com/repos/flovilmart/parse-server","forks_url":"https://api.github.com/repos/flovilmart/parse-server/forks","keys_url":"https://api.github.com/repos/flovilmart/parse-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flovilmart/parse-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flovilmart/parse-server/teams","hooks_url":"https://api.github.com/repos/flovilmart/parse-server/hooks","issue_events_url":"https://api.github.com/repos/flovilmart/parse-server/issues/events{/number}","events_url":"https://api.github.com/repos/flovilmart/parse-server/events","assignees_url":"https://api.github.com/repos/flovilmart/parse-server/assignees{/user}","branches_url":"https://api.github.com/repos/flovilmart/parse-server/branches{/branch}","tags_url":"https://api.github.com/repos/flovilmart/parse-server/tags","blobs_url":"https://api.github.com/repos/flovilmart/parse-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flovilmart/parse-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flovilmart/parse-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/flovilmart/parse-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flovilmart/parse-server/statuses/{sha}","languages_url":"https://api.github.com/repos/flovilmart/parse-server/languages","stargazers_url":"https://api.github.com/repos/flovilmart/parse-server/stargazers","contributors_url":"https://api.github.com/repos/flovilmart/parse-server/contributors","subscribers_url":"https://api.github.com/repos/flovilmart/parse-server/subscribers","subscription_url":"https://api.github.com/repos/flovilmart/parse-server/subscription","commits_url":"https://api.github.com/repos/flovilmart/parse-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/flovilmart/parse-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/flovilmart/parse-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/flovilmart/parse-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/flovilmart/parse-server/contents/{+path}","compare_url":"https://api.github.com/repos/flovilmart/parse-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flovilmart/parse-server/merges","archive_url":"https://api.github.com/repos/flovilmart/parse-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flovilmart/parse-server/downloads","issues_url":"https://api.github.com/repos/flovilmart/parse-server/issues{/number}","pulls_url":"https://api.github.com/repos/flovilmart/parse-server/pulls{/number}","milestones_url":"https://api.github.com/repos/flovilmart/parse-server/milestones{/number}","notifications_url":"https://api.github.com/repos/flovilmart/parse-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flovilmart/parse-server/labels{/name}","releases_url":"https://api.github.com/repos/flovilmart/parse-server/releases{/id}","deployments_url":"https://api.github.com/repos/flovilmart/parse-server/deployments","created_at":"2016-02-03T16:41:23Z","updated_at":"2016-02-25T03:09:31Z","pushed_at":"2016-02-29T21:35:23Z","git_url":"git://github.com/flovilmart/parse-server.git","ssh_url":"git@github.com:flovilmart/parse-server.git","clone_url":"https://github.com/flovilmart/parse-server.git","svn_url":"https://github.com/flovilmart/parse-server","homepage":null,"size":881,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":2,"default_branch":"master"}},"base":{"label":"ParsePlatform:master","ref":"master","sha":"10efd5d38d7dffeb0af36b5338fc7375abd56109","user":{"login":"ParsePlatform","id":1294580,"avatar_url":"https://avatars.githubusercontent.com/u/1294580?v=3","gravatar_id":"","url":"https://api.github.com/users/ParsePlatform","html_url":"https://github.com/ParsePlatform","followers_url":"https://api.github.com/users/ParsePlatform/followers","following_url":"https://api.github.com/users/ParsePlatform/following{/other_user}","gists_url":"https://api.github.com/users/ParsePlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/ParsePlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParsePlatform/subscriptions","organizations_url":"https://api.github.com/users/ParsePlatform/orgs","repos_url":"https://api.github.com/users/ParsePlatform/repos","events_url":"https://api.github.com/users/ParsePlatform/events{/privacy}","received_events_url":"https://api.github.com/users/ParsePlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":50603846,"name":"parse-server","full_name":"ParsePlatform/parse-server","owner":{"login":"ParsePlatform","id":1294580,"avatar_url":"https://avatars.githubusercontent.com/u/1294580?v=3","gravatar_id":"","url":"https://api.github.com/users/ParsePlatform","html_url":"https://github.com/ParsePlatform","followers_url":"https://api.github.com/users/ParsePlatform/followers","following_url":"https://api.github.com/users/ParsePlatform/following{/other_user}","gists_url":"https://api.github.com/users/ParsePlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/ParsePlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParsePlatform/subscriptions","organizations_url":"https://api.github.com/users/ParsePlatform/orgs","repos_url":"https://api.github.com/users/ParsePlatform/repos","events_url":"https://api.github.com/users/ParsePlatform/events{/privacy}","received_events_url":"https://api.github.com/users/ParsePlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ParsePlatform/parse-server","description":"Parse-compatible API server module for Node/Express","fork":false,"url":"https://api.github.com/repos/ParsePlatform/parse-server","forks_url":"https://api.github.com/repos/ParsePlatform/parse-server/forks","keys_url":"https://api.github.com/repos/ParsePlatform/parse-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ParsePlatform/parse-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ParsePlatform/parse-server/teams","hooks_url":"https://api.github.com/repos/ParsePlatform/parse-server/hooks","issue_events_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/events{/number}","events_url":"https://api.github.com/repos/ParsePlatform/parse-server/events","assignees_url":"https://api.github.com/repos/ParsePlatform/parse-server/assignees{/user}","branches_url":"https://api.github.com/repos/ParsePlatform/parse-server/branches{/branch}","tags_url":"https://api.github.com/repos/ParsePlatform/parse-server/tags","blobs_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ParsePlatform/parse-server/statuses/{sha}","languages_url":"https://api.github.com/repos/ParsePlatform/parse-server/languages","stargazers_url":"https://api.github.com/repos/ParsePlatform/parse-server/stargazers","contributors_url":"https://api.github.com/repos/ParsePlatform/parse-server/contributors","subscribers_url":"https://api.github.com/repos/ParsePlatform/parse-server/subscribers","subscription_url":"https://api.github.com/repos/ParsePlatform/parse-server/subscription","commits_url":"https://api.github.com/repos/ParsePlatform/parse-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/ParsePlatform/parse-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/ParsePlatform/parse-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/ParsePlatform/parse-server/contents/{+path}","compare_url":"https://api.github.com/repos/ParsePlatform/parse-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ParsePlatform/parse-server/merges","archive_url":"https://api.github.com/repos/ParsePlatform/parse-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ParsePlatform/parse-server/downloads","issues_url":"https://api.github.com/repos/ParsePlatform/parse-server/issues{/number}","pulls_url":"https://api.github.com/repos/ParsePlatform/parse-server/pulls{/number}","milestones_url":"https://api.github.com/repos/ParsePlatform/parse-server/milestones{/number}","notifications_url":"https://api.github.com/repos/ParsePlatform/parse-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ParsePlatform/parse-server/labels{/name}","releases_url":"https://api.github.com/repos/ParsePlatform/parse-server/releases{/id}","deployments_url":"https://api.github.com/repos/ParsePlatform/parse-server/deployments","created_at":"2016-01-28T18:29:14Z","updated_at":"2016-02-29T22:48:27Z","pushed_at":"2016-02-29T22:40:23Z","git_url":"git://github.com/ParsePlatform/parse-server.git","ssh_url":"git@github.com:ParsePlatform/parse-server.git","clone_url":"https://github.com/ParsePlatform/parse-server.git","svn_url":"https://github.com/ParsePlatform/parse-server","homepage":null,"size":2166,"stargazers_count":6709,"watchers_count":6709,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1455,"mirror_url":null,"open_issues_count":83,"forks":1455,"open_issues":83,"watchers":6709,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627"},"html":{"href":"https://github.com/ParsePlatform/parse-server/pull/627"},"issue":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/issues/627"},"comments":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/issues/627/comments"},"review_comments":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627/comments"},"review_comment":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/pulls/627/commits"},"statuses":{"href":"https://api.github.com/repos/ParsePlatform/parse-server/statuses/284468d7fee5b06c62a023b836b1cb28cde98c82"}}}}