{"action":"created","comment":{"url":"https://api.github.com/repos/andela/thor-ah/pulls/comments/214763382","pull_request_review_id":151882761,"id":214763382,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDc2MzM4Mg==","diff_hunk":"@@ -0,0 +1,50 @@\n+import jwt from 'jsonwebtoken';\n+import dotenv from 'dotenv';","path":"server/utils/TokenHelper.js","position":2,"original_position":2,"commit_id":"947ff70ab2544b591624b2e0978ab05999624bf0","original_commit_id":"947ff70ab2544b591624b2e0978ab05999624bf0","user":{"login":"houndci-bot","id":6697940,"node_id":"MDQ6VXNlcjY2OTc5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/6697940?v=4","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"'import' is only available in ES6 (use 'esversion: 6').","created_at":"2018-09-03T23:54:11Z","updated_at":"2018-09-03T23:54:12Z","html_url":"https://github.com/andela/thor-ah/pull/20#discussion_r214763382","pull_request_url":"https://api.github.com/repos/andela/thor-ah/pulls/20","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/comments/214763382"},"html":{"href":"https://github.com/andela/thor-ah/pull/20#discussion_r214763382"},"pull_request":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/20"}}},"pull_request":{"url":"https://api.github.com/repos/andela/thor-ah/pulls/20","id":212829161,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyODI5MTYx","html_url":"https://github.com/andela/thor-ah/pull/20","diff_url":"https://github.com/andela/thor-ah/pull/20.diff","patch_url":"https://github.com/andela/thor-ah/pull/20.patch","issue_url":"https://api.github.com/repos/andela/thor-ah/issues/20","number":20,"state":"open","locked":false,"title":"#159987687 Users should receive a JWT on Successful Registration","user":{"login":"CEOehis","id":25967737,"node_id":"MDQ6VXNlcjI1OTY3NzM3","avatar_url":"https://avatars0.githubusercontent.com/u/25967737?v=4","gravatar_id":"","url":"https://api.github.com/users/CEOehis","html_url":"https://github.com/CEOehis","followers_url":"https://api.github.com/users/CEOehis/followers","following_url":"https://api.github.com/users/CEOehis/following{/other_user}","gists_url":"https://api.github.com/users/CEOehis/gists{/gist_id}","starred_url":"https://api.github.com/users/CEOehis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CEOehis/subscriptions","organizations_url":"https://api.github.com/users/CEOehis/orgs","repos_url":"https://api.github.com/users/CEOehis/repos","events_url":"https://api.github.com/users/CEOehis/events{/privacy}","received_events_url":"https://api.github.com/users/CEOehis/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nenable users to receive a JWT on Successful Registration\r\n\r\n#### Description of Task to be completed?\r\n- Implement JWT helper\r\n- Implement authentication/authorization middleware for protected resources\r\n- Include relevant tests\r\n\r\n#### How should this be manually tested?\r\nRun 'npm install'\r\ncreate a .env using the .env.sample template\r\nRun 'npm run migrate'\r\nRun 'npm run start:dev'\r\nuse postman to test `/api/users` and `/api/users/login` endpoints\r\n\r\n#### Any background context you want to provide?\r\nThe app previously used sessions with passport.js strategy for authentication.\r\n\r\n#### What are the relevant pivotal tracker stories?\r\n[#159987687](https://www.pivotaltracker.com/story/show/159987687)","created_at":"2018-09-03T23:54:01Z","updated_at":"2018-09-03T23:54:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"23fa7559176a6e5e4d95af2f599fa1634c55f3f6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/andela/thor-ah/pulls/20/commits","review_comments_url":"https://api.github.com/repos/andela/thor-ah/pulls/20/comments","review_comment_url":"https://api.github.com/repos/andela/thor-ah/pulls/comments{/number}","comments_url":"https://api.github.com/repos/andela/thor-ah/issues/20/comments","statuses_url":"https://api.github.com/repos/andela/thor-ah/statuses/947ff70ab2544b591624b2e0978ab05999624bf0","head":{"label":"andela:ft-use-jwt-authentication-159987687","ref":"ft-use-jwt-authentication-159987687","sha":"947ff70ab2544b591624b2e0978ab05999624bf0","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":145831905,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzE5MDU=","name":"thor-ah","full_name":"andela/thor-ah","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},"private":false,"html_url":"https://github.com/andela/thor-ah","description":"Staging Link for Author's Haven ","fork":false,"url":"https://api.github.com/repos/andela/thor-ah","forks_url":"https://api.github.com/repos/andela/thor-ah/forks","keys_url":"https://api.github.com/repos/andela/thor-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/thor-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/thor-ah/teams","hooks_url":"https://api.github.com/repos/andela/thor-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/thor-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/thor-ah/events","assignees_url":"https://api.github.com/repos/andela/thor-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/thor-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/thor-ah/tags","blobs_url":"https://api.github.com/repos/andela/thor-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/thor-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/thor-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/thor-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/thor-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/thor-ah/languages","stargazers_url":"https://api.github.com/repos/andela/thor-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/thor-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/thor-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/thor-ah/subscription","commits_url":"https://api.github.com/repos/andela/thor-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/thor-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/thor-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/thor-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/thor-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/thor-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/thor-ah/merges","archive_url":"https://api.github.com/repos/andela/thor-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/thor-ah/downloads","issues_url":"https://api.github.com/repos/andela/thor-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/thor-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/thor-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/thor-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/thor-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/thor-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/thor-ah/deployments","created_at":"2018-08-23T09:31:23Z","updated_at":"2018-09-03T16:14:00Z","pushed_at":"2018-09-03T23:54:01Z","git_url":"git://github.com/andela/thor-ah.git","ssh_url":"git@github.com:andela/thor-ah.git","clone_url":"https://github.com/andela/thor-ah.git","svn_url":"https://github.com/andela/thor-ah","homepage":"https://thor-ah-staging.herokuapp.com/","size":122,"stargazers_count":5,"watchers_count":5,"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":5,"default_branch":"develop"}},"base":{"label":"andela:develop","ref":"develop","sha":"ca8bf8c690ef617f7c866ca1215a9193bebe7f2f","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":145831905,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU4MzE5MDU=","name":"thor-ah","full_name":"andela/thor-ah","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},"private":false,"html_url":"https://github.com/andela/thor-ah","description":"Staging Link for Author's Haven ","fork":false,"url":"https://api.github.com/repos/andela/thor-ah","forks_url":"https://api.github.com/repos/andela/thor-ah/forks","keys_url":"https://api.github.com/repos/andela/thor-ah/keys{/key_id}","collaborators_url":"https://api.github.com/repos/andela/thor-ah/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/andela/thor-ah/teams","hooks_url":"https://api.github.com/repos/andela/thor-ah/hooks","issue_events_url":"https://api.github.com/repos/andela/thor-ah/issues/events{/number}","events_url":"https://api.github.com/repos/andela/thor-ah/events","assignees_url":"https://api.github.com/repos/andela/thor-ah/assignees{/user}","branches_url":"https://api.github.com/repos/andela/thor-ah/branches{/branch}","tags_url":"https://api.github.com/repos/andela/thor-ah/tags","blobs_url":"https://api.github.com/repos/andela/thor-ah/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/andela/thor-ah/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/andela/thor-ah/git/refs{/sha}","trees_url":"https://api.github.com/repos/andela/thor-ah/git/trees{/sha}","statuses_url":"https://api.github.com/repos/andela/thor-ah/statuses/{sha}","languages_url":"https://api.github.com/repos/andela/thor-ah/languages","stargazers_url":"https://api.github.com/repos/andela/thor-ah/stargazers","contributors_url":"https://api.github.com/repos/andela/thor-ah/contributors","subscribers_url":"https://api.github.com/repos/andela/thor-ah/subscribers","subscription_url":"https://api.github.com/repos/andela/thor-ah/subscription","commits_url":"https://api.github.com/repos/andela/thor-ah/commits{/sha}","git_commits_url":"https://api.github.com/repos/andela/thor-ah/git/commits{/sha}","comments_url":"https://api.github.com/repos/andela/thor-ah/comments{/number}","issue_comment_url":"https://api.github.com/repos/andela/thor-ah/issues/comments{/number}","contents_url":"https://api.github.com/repos/andela/thor-ah/contents/{+path}","compare_url":"https://api.github.com/repos/andela/thor-ah/compare/{base}...{head}","merges_url":"https://api.github.com/repos/andela/thor-ah/merges","archive_url":"https://api.github.com/repos/andela/thor-ah/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/andela/thor-ah/downloads","issues_url":"https://api.github.com/repos/andela/thor-ah/issues{/number}","pulls_url":"https://api.github.com/repos/andela/thor-ah/pulls{/number}","milestones_url":"https://api.github.com/repos/andela/thor-ah/milestones{/number}","notifications_url":"https://api.github.com/repos/andela/thor-ah/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/andela/thor-ah/labels{/name}","releases_url":"https://api.github.com/repos/andela/thor-ah/releases{/id}","deployments_url":"https://api.github.com/repos/andela/thor-ah/deployments","created_at":"2018-08-23T09:31:23Z","updated_at":"2018-09-03T16:14:00Z","pushed_at":"2018-09-03T23:54:01Z","git_url":"git://github.com/andela/thor-ah.git","ssh_url":"git@github.com:andela/thor-ah.git","clone_url":"https://github.com/andela/thor-ah.git","svn_url":"https://github.com/andela/thor-ah","homepage":"https://thor-ah-staging.herokuapp.com/","size":122,"stargazers_count":5,"watchers_count":5,"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":5,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/20"},"html":{"href":"https://github.com/andela/thor-ah/pull/20"},"issue":{"href":"https://api.github.com/repos/andela/thor-ah/issues/20"},"comments":{"href":"https://api.github.com/repos/andela/thor-ah/issues/20/comments"},"review_comments":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/20/comments"},"review_comment":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/andela/thor-ah/pulls/20/commits"},"statuses":{"href":"https://api.github.com/repos/andela/thor-ah/statuses/947ff70ab2544b591624b2e0978ab05999624bf0"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"houndci-bot"}}