{"action":"created","comment":{"url":"https://api.github.com/repos/andela/haven-ah-backend/pulls/comments/229972783","pull_request_review_id":170596950,"id":229972783,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyOTk3Mjc4Mw==","diff_hunk":"@@ -24,7 +24,7 @@ const config = {\n     secret: process.env.JWT_SECRET\n   },\n   production: {\n-    use_env_variable: process.env.DATABASE_URL,\n+    use_env_variable: 'DATABASE_URL',","path":"server/config/config.js","position":5,"original_position":5,"commit_id":"d0a9acec31a730b20a1aa7fd8894150dd87d79a0","original_commit_id":"d0a9acec31a730b20a1aa7fd8894150dd87d79a0","user":{"login":"seyi-adeleke","id":7271210,"node_id":"MDQ6VXNlcjcyNzEyMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/7271210?v=4","gravatar_id":"","url":"https://api.github.com/users/seyi-adeleke","html_url":"https://github.com/seyi-adeleke","followers_url":"https://api.github.com/users/seyi-adeleke/followers","following_url":"https://api.github.com/users/seyi-adeleke/following{/other_user}","gists_url":"https://api.github.com/users/seyi-adeleke/gists{/gist_id}","starred_url":"https://api.github.com/users/seyi-adeleke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seyi-adeleke/subscriptions","organizations_url":"https://api.github.com/users/seyi-adeleke/orgs","repos_url":"https://api.github.com/users/seyi-adeleke/repos","events_url":"https://api.github.com/users/seyi-adeleke/events{/privacy}","received_events_url":"https://api.github.com/users/seyi-adeleke/received_events","type":"User","site_admin":false},"body":"Whats this change for?","created_at":"2018-11-01T08:44:36Z","updated_at":"2018-11-01T08:53:33Z","html_url":"https://github.com/andela/haven-ah-backend/pull/17#discussion_r229972783","pull_request_url":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/andela/haven-ah-backend/pulls/comments/229972783"},"html":{"href":"https://github.com/andela/haven-ah-backend/pull/17#discussion_r229972783"},"pull_request":{"href":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17","id":227084350,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI3MDg0MzUw","html_url":"https://github.com/andela/haven-ah-backend/pull/17","diff_url":"https://github.com/andela/haven-ah-backend/pull/17.diff","patch_url":"https://github.com/andela/haven-ah-backend/pull/17.patch","issue_url":"https://api.github.com/repos/andela/haven-ah-backend/issues/17","number":17,"state":"open","locked":false,"title":"#161342836 Implement email confirmation on user registeration","user":{"login":"PriscillaSam","id":29674347,"node_id":"MDQ6VXNlcjI5Njc0MzQ3","avatar_url":"https://avatars1.githubusercontent.com/u/29674347?v=4","gravatar_id":"","url":"https://api.github.com/users/PriscillaSam","html_url":"https://github.com/PriscillaSam","followers_url":"https://api.github.com/users/PriscillaSam/followers","following_url":"https://api.github.com/users/PriscillaSam/following{/other_user}","gists_url":"https://api.github.com/users/PriscillaSam/gists{/gist_id}","starred_url":"https://api.github.com/users/PriscillaSam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PriscillaSam/subscriptions","organizations_url":"https://api.github.com/users/PriscillaSam/orgs","repos_url":"https://api.github.com/users/PriscillaSam/repos","events_url":"https://api.github.com/users/PriscillaSam/events{/privacy}","received_events_url":"https://api.github.com/users/PriscillaSam/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nSend email for account confirmation after signup.\r\n\r\n#### Description of task to be completed\r\n- use nodemailer package for email sending\r\n- add api endpoint to confirm email.\r\n- update http response utility to work in absence of output data.\r\n\r\n#### How should this be manually tested?\r\n- on the terminal run  `git clone https://github.com/andela/haven-ah-backend.git`.\r\n- ensure that PostgreSQL is running on your local machine.\r\n- run `npm install` to install the npm packages.\r\n- run `npm test` to run the unit and integration tests.\r\n\r\nTo test on postman\r\n- run `npm run start-dev`.\r\non postman navigate to localhost:5000/api/users/signup.\r\n\r\n*Sample Request Body*\r\n```gherkin\r\n{\r\n  \"username\": \"string\",\r\n  \"firstName\": \"string\",\r\n  \"lastName\": \"string\",\r\n  \"email\": \"string\",\r\n  \"password\": \"string\",\r\n}\r\n```\r\nOn successful signup, an email would be sent with a url `http://localhost:5000/api/v1/auth/confirm/token`. Clicking on the url takes user to the url and sends a request to confirm user email.\r\n\r\n*Response Body sample*\r\n```gherkhin\r\n{\r\n  \"status\": 200,\r\n  \"message\": \"Your email has been confirmed\"\r\n}\r\n```\r\nIf the account has been previously confirmed, an error **400 Bad Request** is sent.\r\n```gherkhin\r\n{\r\n  \"status\": 400,\r\n  \"message\": \"This account has been confirmed already.\"\r\n}\r\n```\r\n\r\n#### Any background context you want to provide?\r\nThe signup route was previously implemented without email confirmation.\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n#161342836\r\n\r\n#### Screenshots (if appropriate)\r\n<img width=\"1070\" alt=\"screen shot 2018-10-30 at 10 06 16 pm\" src=\"https://user-images.githubusercontent.com/29674347/47750683-3b1da500-dc90-11e8-94da-db32c4406873.png\">\r\n\r\n<img width=\"1069\" alt=\"screen shot 2018-10-30 at 10 04 19 pm\" src=\"https://user-images.githubusercontent.com/29674347/47750727-4d97de80-dc90-11e8-93ce-c78f6dd75af9.png\">\r\n\r\n<img width=\"1066\" alt=\"screen shot 2018-10-31 at 9 54 24 am\" src=\"https://user-images.githubusercontent.com/29674347/47778782-db5ae480-dcf7-11e8-9ce1-7919e69a008e.png\">\r\n","created_at":"2018-10-30T21:16:06Z","updated_at":"2018-11-01T08:53:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"078d9c547cd8c8acd48924ef5dfa251076c1260e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1108406890,"node_id":"MDU6TGFiZWwxMTA4NDA2ODkw","url":"https://api.github.com/repos/andela/haven-ah-backend/labels/Ready","name":"Ready","color":"963f19","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17/commits","review_comments_url":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17/comments","review_comment_url":"https://api.github.com/repos/andela/haven-ah-backend/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/haven-ah-backend/issues/17/comments","statuses_url":"https://api.github.com/repos/andela/haven-ah-backend/statuses/d0a9acec31a730b20a1aa7fd8894150dd87d79a0","head":{"label":"andela:ft-email-verification-161342836","ref":"ft-email-verification-161342836","sha":"d0a9acec31a730b20a1aa7fd8894150dd87d79a0","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":153470751,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM0NzA3NTE=","name":"haven-ah-backend","full_name":"andela/haven-ah-backend","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/haven-ah-backend","description":null,"fork":false,"url":"https://api.github.com/repos/andela/haven-ah-backend","forks_url":"https://api.github.com/repos/andela/haven-ah-backend/forks","keys_url":"https://api.github.com/repos/andela/haven-ah-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/haven-ah-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/haven-ah-backend/teams","hooks_url":"https://api.github.com/repos/andela/haven-ah-backend/hooks","issue_events_url":"https://api.github.com/repos/andela/haven-ah-backend/issues/events{/number}","events_url":"https://api.github.com/repos/andela/haven-ah-backend/events","assignees_url":"https://api.github.com/repos/andela/haven-ah-backend/assignees{/user}","branches_url":"https://api.github.com/repos/andela/haven-ah-backend/branches{/branch}","tags_url":"https://api.github.com/repos/andela/haven-ah-backend/tags","blobs_url":"https://api.github.com/repos/andela/haven-ah-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/haven-ah-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/haven-ah-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/haven-ah-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/haven-ah-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/haven-ah-backend/languages","stargazers_url":"https://api.github.com/repos/andela/haven-ah-backend/stargazers","contributors_url":"https://api.github.com/repos/andela/haven-ah-backend/contributors","subscribers_url":"https://api.github.com/repos/andela/haven-ah-backend/subscribers","subscription_url":"https://api.github.com/repos/andela/haven-ah-backend/subscription","commits_url":"https://api.github.com/repos/andela/haven-ah-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/haven-ah-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/haven-ah-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/haven-ah-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/haven-ah-backend/contents/{+path}","compare_url":"https://api.github.com/repos/andela/haven-ah-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/haven-ah-backend/merges","archive_url":"https://api.github.com/repos/andela/haven-ah-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/haven-ah-backend/downloads","issues_url":"https://api.github.com/repos/andela/haven-ah-backend/issues{/number}","pulls_url":"https://api.github.com/repos/andela/haven-ah-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/haven-ah-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/haven-ah-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/haven-ah-backend/labels{/name}","releases_url":"https://api.github.com/repos/andela/haven-ah-backend/releases{/id}","deployments_url":"https://api.github.com/repos/andela/haven-ah-backend/deployments","created_at":"2018-10-17T14:26:26Z","updated_at":"2018-10-30T19:01:09Z","pushed_at":"2018-11-01T08:52:27Z","git_url":"git://github.com/andela/haven-ah-backend.git","ssh_url":"git@github.com:andela/haven-ah-backend.git","clone_url":"https://github.com/andela/haven-ah-backend.git","svn_url":"https://github.com/andela/haven-ah-backend","homepage":null,"size":198,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":2,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"f7edd898ae2f57c31a7dad13ac1e860286fc1850","user":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"repo":{"id":153470751,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM0NzA3NTE=","name":"haven-ah-backend","full_name":"andela/haven-ah-backend","private":false,"owner":{"login":"andela","id":4100206,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQxMDAyMDY=","avatar_url":"https://avatars2.githubusercontent.com/u/4100206?v=4","gravatar_id":"","url":"https://api.github.com/users/andela","html_url":"https://github.com/andela","followers_url":"https://api.github.com/users/andela/followers","following_url":"https://api.github.com/users/andela/following{/other_user}","gists_url":"https://api.github.com/users/andela/gists{/gist_id}","starred_url":"https://api.github.com/users/andela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andela/subscriptions","organizations_url":"https://api.github.com/users/andela/orgs","repos_url":"https://api.github.com/users/andela/repos","events_url":"https://api.github.com/users/andela/events{/privacy}","received_events_url":"https://api.github.com/users/andela/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/andela/haven-ah-backend","description":null,"fork":false,"url":"https://api.github.com/repos/andela/haven-ah-backend","forks_url":"https://api.github.com/repos/andela/haven-ah-backend/forks","keys_url":"https://api.github.com/repos/andela/haven-ah-backend/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/haven-ah-backend/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/haven-ah-backend/teams","hooks_url":"https://api.github.com/repos/andela/haven-ah-backend/hooks","issue_events_url":"https://api.github.com/repos/andela/haven-ah-backend/issues/events{/number}","events_url":"https://api.github.com/repos/andela/haven-ah-backend/events","assignees_url":"https://api.github.com/repos/andela/haven-ah-backend/assignees{/user}","branches_url":"https://api.github.com/repos/andela/haven-ah-backend/branches{/branch}","tags_url":"https://api.github.com/repos/andela/haven-ah-backend/tags","blobs_url":"https://api.github.com/repos/andela/haven-ah-backend/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/haven-ah-backend/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/haven-ah-backend/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/haven-ah-backend/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/haven-ah-backend/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/haven-ah-backend/languages","stargazers_url":"https://api.github.com/repos/andela/haven-ah-backend/stargazers","contributors_url":"https://api.github.com/repos/andela/haven-ah-backend/contributors","subscribers_url":"https://api.github.com/repos/andela/haven-ah-backend/subscribers","subscription_url":"https://api.github.com/repos/andela/haven-ah-backend/subscription","commits_url":"https://api.github.com/repos/andela/haven-ah-backend/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/haven-ah-backend/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/haven-ah-backend/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/haven-ah-backend/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/haven-ah-backend/contents/{+path}","compare_url":"https://api.github.com/repos/andela/haven-ah-backend/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/haven-ah-backend/merges","archive_url":"https://api.github.com/repos/andela/haven-ah-backend/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/haven-ah-backend/downloads","issues_url":"https://api.github.com/repos/andela/haven-ah-backend/issues{/number}","pulls_url":"https://api.github.com/repos/andela/haven-ah-backend/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/haven-ah-backend/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/haven-ah-backend/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/haven-ah-backend/labels{/name}","releases_url":"https://api.github.com/repos/andela/haven-ah-backend/releases{/id}","deployments_url":"https://api.github.com/repos/andela/haven-ah-backend/deployments","created_at":"2018-10-17T14:26:26Z","updated_at":"2018-10-30T19:01:09Z","pushed_at":"2018-11-01T08:52:27Z","git_url":"git://github.com/andela/haven-ah-backend.git","ssh_url":"git@github.com:andela/haven-ah-backend.git","clone_url":"https://github.com/andela/haven-ah-backend.git","svn_url":"https://github.com/andela/haven-ah-backend","homepage":null,"size":198,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":4,"license":null,"forks":0,"open_issues":4,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17"},"html":{"href":"https://github.com/andela/haven-ah-backend/pull/17"},"issue":{"href":"https://api.github.com/repos/andela/haven-ah-backend/issues/17"},"comments":{"href":"https://api.github.com/repos/andela/haven-ah-backend/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/haven-ah-backend/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/haven-ah-backend/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/andela/haven-ah-backend/statuses/d0a9acec31a730b20a1aa7fd8894150dd87d79a0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"seyi-adeleke"}}