{"action":"created","comment":{"url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/comments/79704837","id":79704837,"diff_hunk":"@@ -14,5 +14,6 @@ module.exports = {\n   SECRET: process.env.SECRET,\n   EMAIL: process.env.EMAIL,\n   EMAIL_PASS: process.env.EMAIL_PASS,\n-  TOKEN_LIFE: process.env.TOKEN_LIFE\n+  TOKEN_LIFE: process.env.TOKEN_LIFE,\n+  SALT_FACTOR: process.env.SALT_FACTOR","path":"src/config/config.js","position":null,"original_position":6,"commit_id":"9f0f5f88e4f4464ebdb99001255142961c151ebc","original_commit_id":"9f0f5f88e4f4464ebdb99001255142961c151ebc","user":{"login":"kevinpr007","id":20975896,"avatar_url":"https://avatars.githubusercontent.com/u/20975896?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinpr007","html_url":"https://github.com/kevinpr007","followers_url":"https://api.github.com/users/kevinpr007/followers","following_url":"https://api.github.com/users/kevinpr007/following{/other_user}","gists_url":"https://api.github.com/users/kevinpr007/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinpr007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinpr007/subscriptions","organizations_url":"https://api.github.com/users/kevinpr007/orgs","repos_url":"https://api.github.com/users/kevinpr007/repos","events_url":"https://api.github.com/users/kevinpr007/events{/privacy}","received_events_url":"https://api.github.com/users/kevinpr007/received_events","type":"User","site_admin":false},"body":"Nice!","created_at":"2016-09-20T20:31:06Z","updated_at":"2016-09-20T20:31:06Z","html_url":"https://github.com/Ivan-Marquez/stylepoint/pull/7#discussion_r79704837","pull_request_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/comments/79704837"},"html":{"href":"https://github.com/Ivan-Marquez/stylepoint/pull/7#discussion_r79704837"},"pull_request":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7","id":85729586,"html_url":"https://github.com/Ivan-Marquez/stylepoint/pull/7","diff_url":"https://github.com/Ivan-Marquez/stylepoint/pull/7.diff","patch_url":"https://github.com/Ivan-Marquez/stylepoint/pull/7.patch","issue_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/7","number":7,"state":"open","locked":false,"title":"Feature/auth layer","user":{"login":"Ivan-Marquez","id":7785035,"avatar_url":"https://avatars.githubusercontent.com/u/7785035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ivan-Marquez","html_url":"https://github.com/Ivan-Marquez","followers_url":"https://api.github.com/users/Ivan-Marquez/followers","following_url":"https://api.github.com/users/Ivan-Marquez/following{/other_user}","gists_url":"https://api.github.com/users/Ivan-Marquez/gists{/gist_id}","starred_url":"https://api.github.com/users/Ivan-Marquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ivan-Marquez/subscriptions","organizations_url":"https://api.github.com/users/Ivan-Marquez/orgs","repos_url":"https://api.github.com/users/Ivan-Marquez/repos","events_url":"https://api.github.com/users/Ivan-Marquez/events{/privacy}","received_events_url":"https://api.github.com/users/Ivan-Marquez/received_events","type":"User","site_admin":false},"body":"# Style Point Auth Layer\r\n> Adding authentication to Style Point API\r\n\r\n## Change log: \r\n+ Added security middleware with [passport](https://www.npmjs.com/package/passport).\r\n+ Added strategies:\r\n    + [local](https://www.npmjs.com/package/passport-local): user/password authentication.\r\n    + [jwt](https://www.npmjs.com/package/passport-jwt): token-based authentication.\r\n+ Added routes and controller for authentication:\r\n    + `api/auth`: authenticate with email/password.\r\n    + `api/register`: register with email/password/full name.\r\n    + `api/confirm-reset-password`: request password change.\r\n    + `api/reset-password/:token`: reset password with provided reset password token.\r\n+ Added email templates for password reset request and confirmation using [nodemailer](https://www.npmjs.com/package/nodemailer).\r\n+ Updated User model with the following properties and middleware:\r\n    + `password`: user's password.\r\n    +  `isValidPassword`: to compare password with user's hashed password.\r\n    + `pre-save`: to hash password before saving user object.\r\n    + `userSchema.set(<transform>)`: to remove user's password before returning a user.\r\n    + `passwordResetToken`: token to confirm password change request.\r\n    + `passwordResetTokenExpires`: reset password token expiration date.\r\n\r\n## Additional changes:\r\n+ Added [nodemon](https://www.npmjs.com/package/nodemon) dev dependency for automatic server reloading.\r\n+ Removed all session related code. Communication is going to be token-based.\r\n+ Updated express config global error handling.\r\n+ Added [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) config to express config file.\r\n+ Updated response status codes with http-status-codes constants.\r\n+ Updated env variables config file to return object for easier typing (object properties instead of key parameter). \r\n\r\n## Pending changes:\r\n+ Add view to reset user's password.\r\n+ Authorize requests by user's role (once the roles are defined).\r\n+ Analyze token lifetime. It's configured to expire in 3 hours.\r\n\r\n**Note:**\r\nThe following env variables are needed for this code to work properly:\r\n+ SECRET\r\n+ TOKEN_LIFE\r\n+ EMAIL\r\n+ EMAIL_PASS","created_at":"2016-09-19T01:13:42Z","updated_at":"2016-09-20T20:31:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81bf26cb6c26503ea00cb7b4a625aad691fabd56","assignee":{"login":"kevinpr007","id":20975896,"avatar_url":"https://avatars.githubusercontent.com/u/20975896?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinpr007","html_url":"https://github.com/kevinpr007","followers_url":"https://api.github.com/users/kevinpr007/followers","following_url":"https://api.github.com/users/kevinpr007/following{/other_user}","gists_url":"https://api.github.com/users/kevinpr007/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinpr007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinpr007/subscriptions","organizations_url":"https://api.github.com/users/kevinpr007/orgs","repos_url":"https://api.github.com/users/kevinpr007/repos","events_url":"https://api.github.com/users/kevinpr007/events{/privacy}","received_events_url":"https://api.github.com/users/kevinpr007/received_events","type":"User","site_admin":false},"assignees":[{"login":"kevinpr007","id":20975896,"avatar_url":"https://avatars.githubusercontent.com/u/20975896?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinpr007","html_url":"https://github.com/kevinpr007","followers_url":"https://api.github.com/users/kevinpr007/followers","following_url":"https://api.github.com/users/kevinpr007/following{/other_user}","gists_url":"https://api.github.com/users/kevinpr007/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinpr007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinpr007/subscriptions","organizations_url":"https://api.github.com/users/kevinpr007/orgs","repos_url":"https://api.github.com/users/kevinpr007/repos","events_url":"https://api.github.com/users/kevinpr007/events{/privacy}","received_events_url":"https://api.github.com/users/kevinpr007/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7/commits","review_comments_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7/comments","review_comment_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/7/comments","statuses_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/statuses/9f0f5f88e4f4464ebdb99001255142961c151ebc","head":{"label":"Ivan-Marquez:feature/auth-layer","ref":"feature/auth-layer","sha":"9f0f5f88e4f4464ebdb99001255142961c151ebc","user":{"login":"Ivan-Marquez","id":7785035,"avatar_url":"https://avatars.githubusercontent.com/u/7785035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ivan-Marquez","html_url":"https://github.com/Ivan-Marquez","followers_url":"https://api.github.com/users/Ivan-Marquez/followers","following_url":"https://api.github.com/users/Ivan-Marquez/following{/other_user}","gists_url":"https://api.github.com/users/Ivan-Marquez/gists{/gist_id}","starred_url":"https://api.github.com/users/Ivan-Marquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ivan-Marquez/subscriptions","organizations_url":"https://api.github.com/users/Ivan-Marquez/orgs","repos_url":"https://api.github.com/users/Ivan-Marquez/repos","events_url":"https://api.github.com/users/Ivan-Marquez/events{/privacy}","received_events_url":"https://api.github.com/users/Ivan-Marquez/received_events","type":"User","site_admin":false},"repo":{"id":66889095,"name":"stylepoint","full_name":"Ivan-Marquez/stylepoint","owner":{"login":"Ivan-Marquez","id":7785035,"avatar_url":"https://avatars.githubusercontent.com/u/7785035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ivan-Marquez","html_url":"https://github.com/Ivan-Marquez","followers_url":"https://api.github.com/users/Ivan-Marquez/followers","following_url":"https://api.github.com/users/Ivan-Marquez/following{/other_user}","gists_url":"https://api.github.com/users/Ivan-Marquez/gists{/gist_id}","starred_url":"https://api.github.com/users/Ivan-Marquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ivan-Marquez/subscriptions","organizations_url":"https://api.github.com/users/Ivan-Marquez/orgs","repos_url":"https://api.github.com/users/Ivan-Marquez/repos","events_url":"https://api.github.com/users/Ivan-Marquez/events{/privacy}","received_events_url":"https://api.github.com/users/Ivan-Marquez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ivan-Marquez/stylepoint","description":"Style Point is a schedule service that connects people to barbers and stylists at the time and location of your choice!","fork":false,"url":"https://api.github.com/repos/Ivan-Marquez/stylepoint","forks_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/forks","keys_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/teams","hooks_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/hooks","issue_events_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/events{/number}","events_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/events","assignees_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/assignees{/user}","branches_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/branches{/branch}","tags_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/tags","blobs_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/statuses/{sha}","languages_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/languages","stargazers_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/stargazers","contributors_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/contributors","subscribers_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/subscribers","subscription_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/subscription","commits_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/contents/{+path}","compare_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/merges","archive_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/downloads","issues_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues{/number}","pulls_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls{/number}","milestones_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/milestones{/number}","notifications_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/labels{/name}","releases_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/releases{/id}","deployments_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/deployments","created_at":"2016-08-29T23:45:25Z","updated_at":"2016-09-15T13:45:19Z","pushed_at":"2016-09-20T20:29:36Z","git_url":"git://github.com/Ivan-Marquez/stylepoint.git","ssh_url":"git@github.com:Ivan-Marquez/stylepoint.git","clone_url":"https://github.com/Ivan-Marquez/stylepoint.git","svn_url":"https://github.com/Ivan-Marquez/stylepoint","homepage":null,"size":82,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"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":1,"default_branch":"master"}},"base":{"label":"Ivan-Marquez:develop","ref":"develop","sha":"d343749b2d8444e926d2acd161d771c1c3f6877d","user":{"login":"Ivan-Marquez","id":7785035,"avatar_url":"https://avatars.githubusercontent.com/u/7785035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ivan-Marquez","html_url":"https://github.com/Ivan-Marquez","followers_url":"https://api.github.com/users/Ivan-Marquez/followers","following_url":"https://api.github.com/users/Ivan-Marquez/following{/other_user}","gists_url":"https://api.github.com/users/Ivan-Marquez/gists{/gist_id}","starred_url":"https://api.github.com/users/Ivan-Marquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ivan-Marquez/subscriptions","organizations_url":"https://api.github.com/users/Ivan-Marquez/orgs","repos_url":"https://api.github.com/users/Ivan-Marquez/repos","events_url":"https://api.github.com/users/Ivan-Marquez/events{/privacy}","received_events_url":"https://api.github.com/users/Ivan-Marquez/received_events","type":"User","site_admin":false},"repo":{"id":66889095,"name":"stylepoint","full_name":"Ivan-Marquez/stylepoint","owner":{"login":"Ivan-Marquez","id":7785035,"avatar_url":"https://avatars.githubusercontent.com/u/7785035?v=3","gravatar_id":"","url":"https://api.github.com/users/Ivan-Marquez","html_url":"https://github.com/Ivan-Marquez","followers_url":"https://api.github.com/users/Ivan-Marquez/followers","following_url":"https://api.github.com/users/Ivan-Marquez/following{/other_user}","gists_url":"https://api.github.com/users/Ivan-Marquez/gists{/gist_id}","starred_url":"https://api.github.com/users/Ivan-Marquez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ivan-Marquez/subscriptions","organizations_url":"https://api.github.com/users/Ivan-Marquez/orgs","repos_url":"https://api.github.com/users/Ivan-Marquez/repos","events_url":"https://api.github.com/users/Ivan-Marquez/events{/privacy}","received_events_url":"https://api.github.com/users/Ivan-Marquez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Ivan-Marquez/stylepoint","description":"Style Point is a schedule service that connects people to barbers and stylists at the time and location of your choice!","fork":false,"url":"https://api.github.com/repos/Ivan-Marquez/stylepoint","forks_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/forks","keys_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/teams","hooks_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/hooks","issue_events_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/events{/number}","events_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/events","assignees_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/assignees{/user}","branches_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/branches{/branch}","tags_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/tags","blobs_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/refs{/sha}","trees_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/statuses/{sha}","languages_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/languages","stargazers_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/stargazers","contributors_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/contributors","subscribers_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/subscribers","subscription_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/subscription","commits_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/commits{/sha}","git_commits_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/git/commits{/sha}","comments_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/comments{/number}","issue_comment_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/comments{/number}","contents_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/contents/{+path}","compare_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/merges","archive_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/downloads","issues_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues{/number}","pulls_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls{/number}","milestones_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/milestones{/number}","notifications_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/labels{/name}","releases_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/releases{/id}","deployments_url":"https://api.github.com/repos/Ivan-Marquez/stylepoint/deployments","created_at":"2016-08-29T23:45:25Z","updated_at":"2016-09-15T13:45:19Z","pushed_at":"2016-09-20T20:29:36Z","git_url":"git://github.com/Ivan-Marquez/stylepoint.git","ssh_url":"git@github.com:Ivan-Marquez/stylepoint.git","clone_url":"https://github.com/Ivan-Marquez/stylepoint.git","svn_url":"https://github.com/Ivan-Marquez/stylepoint","homepage":null,"size":82,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"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":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7"},"html":{"href":"https://github.com/Ivan-Marquez/stylepoint/pull/7"},"issue":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/7"},"comments":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/Ivan-Marquez/stylepoint/statuses/9f0f5f88e4f4464ebdb99001255142961c151ebc"}}}}
{"actor":{"display_login":"kevinpr007"}}