{"action":"created","comment":{"url":"https://api.github.com/repos/trunk-studio/trademuch/pulls/comments/59486434","id":59486434,"diff_hunk":"@@ -14,7 +14,8 @@ module.exports = async function(req, res, next) {\n   console.log(req.headers);\n   try {\n     if(typeof req.body != \"undefined\" || typeof req.headers != \"undefined\") {\n-      if(req.headers.jwt && req.headers.jwt != 'null'){\n+      const hasJwt = req.headers.jwt && req.headers.jwt != 'null';\n+      if(hasJwt){\n         if (UserService.getLoginState(req)) {\n           return next();","path":"api/policies/sessionAuth.js","position":null,"original_position":8,"commit_id":"28933f9b688040bf7b9fcc26c82740ec10953c0c","original_commit_id":"28933f9b688040bf7b9fcc26c82740ec10953c0c","user":{"login":"smlsunxie","id":1689227,"avatar_url":"https://avatars.githubusercontent.com/u/1689227?v=3","gravatar_id":"","url":"https://api.github.com/users/smlsunxie","html_url":"https://github.com/smlsunxie","followers_url":"https://api.github.com/users/smlsunxie/followers","following_url":"https://api.github.com/users/smlsunxie/following{/other_user}","gists_url":"https://api.github.com/users/smlsunxie/gists{/gist_id}","starred_url":"https://api.github.com/users/smlsunxie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smlsunxie/subscriptions","organizations_url":"https://api.github.com/users/smlsunxie/orgs","repos_url":"https://api.github.com/users/smlsunxie/repos","events_url":"https://api.github.com/users/smlsunxie/events{/privacy}","received_events_url":"https://api.github.com/users/smlsunxie/received_events","type":"User","site_admin":false},"body":"三個 if 可以合併成一個 if  了","created_at":"2016-04-13T02:52:28Z","updated_at":"2016-04-13T02:52:28Z","html_url":"https://github.com/trunk-studio/trademuch/pull/535#discussion_r59486434","pull_request_url":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535","_links":{"self":{"href":"https://api.github.com/repos/trunk-studio/trademuch/pulls/comments/59486434"},"html":{"href":"https://github.com/trunk-studio/trademuch/pull/535#discussion_r59486434"},"pull_request":{"href":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535"}}},"pull_request":{"url":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535","id":65771060,"html_url":"https://github.com/trunk-studio/trademuch/pull/535","diff_url":"https://github.com/trunk-studio/trademuch/pull/535.diff","patch_url":"https://github.com/trunk-studio/trademuch/pull/535.patch","issue_url":"https://api.github.com/repos/trunk-studio/trademuch/issues/535","number":535,"state":"open","locked":false,"title":"fix sessionAuth","user":{"login":"FuYaoDe","id":6357215,"avatar_url":"https://avatars.githubusercontent.com/u/6357215?v=3","gravatar_id":"","url":"https://api.github.com/users/FuYaoDe","html_url":"https://github.com/FuYaoDe","followers_url":"https://api.github.com/users/FuYaoDe/followers","following_url":"https://api.github.com/users/FuYaoDe/following{/other_user}","gists_url":"https://api.github.com/users/FuYaoDe/gists{/gist_id}","starred_url":"https://api.github.com/users/FuYaoDe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FuYaoDe/subscriptions","organizations_url":"https://api.github.com/users/FuYaoDe/orgs","repos_url":"https://api.github.com/users/FuYaoDe/repos","events_url":"https://api.github.com/users/FuYaoDe/events{/privacy}","received_events_url":"https://api.github.com/users/FuYaoDe/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-04-08T11:12:20Z","updated_at":"2016-04-13T02:52:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ffd9bffcef6fa5020b0ec0634e7ea1d4e2e9f40","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535/commits","review_comments_url":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535/comments","review_comment_url":"https://api.github.com/repos/trunk-studio/trademuch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trunk-studio/trademuch/issues/535/comments","statuses_url":"https://api.github.com/repos/trunk-studio/trademuch/statuses/28933f9b688040bf7b9fcc26c82740ec10953c0c","head":{"label":"FuYaoDe:master","ref":"master","sha":"28933f9b688040bf7b9fcc26c82740ec10953c0c","user":{"login":"FuYaoDe","id":6357215,"avatar_url":"https://avatars.githubusercontent.com/u/6357215?v=3","gravatar_id":"","url":"https://api.github.com/users/FuYaoDe","html_url":"https://github.com/FuYaoDe","followers_url":"https://api.github.com/users/FuYaoDe/followers","following_url":"https://api.github.com/users/FuYaoDe/following{/other_user}","gists_url":"https://api.github.com/users/FuYaoDe/gists{/gist_id}","starred_url":"https://api.github.com/users/FuYaoDe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FuYaoDe/subscriptions","organizations_url":"https://api.github.com/users/FuYaoDe/orgs","repos_url":"https://api.github.com/users/FuYaoDe/repos","events_url":"https://api.github.com/users/FuYaoDe/events{/privacy}","received_events_url":"https://api.github.com/users/FuYaoDe/received_events","type":"User","site_admin":false},"repo":{"id":46698556,"name":"Trademuch","full_name":"FuYaoDe/Trademuch","owner":{"login":"FuYaoDe","id":6357215,"avatar_url":"https://avatars.githubusercontent.com/u/6357215?v=3","gravatar_id":"","url":"https://api.github.com/users/FuYaoDe","html_url":"https://github.com/FuYaoDe","followers_url":"https://api.github.com/users/FuYaoDe/followers","following_url":"https://api.github.com/users/FuYaoDe/following{/other_user}","gists_url":"https://api.github.com/users/FuYaoDe/gists{/gist_id}","starred_url":"https://api.github.com/users/FuYaoDe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FuYaoDe/subscriptions","organizations_url":"https://api.github.com/users/FuYaoDe/orgs","repos_url":"https://api.github.com/users/FuYaoDe/repos","events_url":"https://api.github.com/users/FuYaoDe/events{/privacy}","received_events_url":"https://api.github.com/users/FuYaoDe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/FuYaoDe/Trademuch","description":"","fork":true,"url":"https://api.github.com/repos/FuYaoDe/Trademuch","forks_url":"https://api.github.com/repos/FuYaoDe/Trademuch/forks","keys_url":"https://api.github.com/repos/FuYaoDe/Trademuch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FuYaoDe/Trademuch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FuYaoDe/Trademuch/teams","hooks_url":"https://api.github.com/repos/FuYaoDe/Trademuch/hooks","issue_events_url":"https://api.github.com/repos/FuYaoDe/Trademuch/issues/events{/number}","events_url":"https://api.github.com/repos/FuYaoDe/Trademuch/events","assignees_url":"https://api.github.com/repos/FuYaoDe/Trademuch/assignees{/user}","branches_url":"https://api.github.com/repos/FuYaoDe/Trademuch/branches{/branch}","tags_url":"https://api.github.com/repos/FuYaoDe/Trademuch/tags","blobs_url":"https://api.github.com/repos/FuYaoDe/Trademuch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FuYaoDe/Trademuch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FuYaoDe/Trademuch/git/refs{/sha}","trees_url":"https://api.github.com/repos/FuYaoDe/Trademuch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FuYaoDe/Trademuch/statuses/{sha}","languages_url":"https://api.github.com/repos/FuYaoDe/Trademuch/languages","stargazers_url":"https://api.github.com/repos/FuYaoDe/Trademuch/stargazers","contributors_url":"https://api.github.com/repos/FuYaoDe/Trademuch/contributors","subscribers_url":"https://api.github.com/repos/FuYaoDe/Trademuch/subscribers","subscription_url":"https://api.github.com/repos/FuYaoDe/Trademuch/subscription","commits_url":"https://api.github.com/repos/FuYaoDe/Trademuch/commits{/sha}","git_commits_url":"https://api.github.com/repos/FuYaoDe/Trademuch/git/commits{/sha}","comments_url":"https://api.github.com/repos/FuYaoDe/Trademuch/comments{/number}","issue_comment_url":"https://api.github.com/repos/FuYaoDe/Trademuch/issues/comments{/number}","contents_url":"https://api.github.com/repos/FuYaoDe/Trademuch/contents/{+path}","compare_url":"https://api.github.com/repos/FuYaoDe/Trademuch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FuYaoDe/Trademuch/merges","archive_url":"https://api.github.com/repos/FuYaoDe/Trademuch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FuYaoDe/Trademuch/downloads","issues_url":"https://api.github.com/repos/FuYaoDe/Trademuch/issues{/number}","pulls_url":"https://api.github.com/repos/FuYaoDe/Trademuch/pulls{/number}","milestones_url":"https://api.github.com/repos/FuYaoDe/Trademuch/milestones{/number}","notifications_url":"https://api.github.com/repos/FuYaoDe/Trademuch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FuYaoDe/Trademuch/labels{/name}","releases_url":"https://api.github.com/repos/FuYaoDe/Trademuch/releases{/id}","deployments_url":"https://api.github.com/repos/FuYaoDe/Trademuch/deployments","created_at":"2015-11-23T05:26:47Z","updated_at":"2016-02-20T18:11:04Z","pushed_at":"2016-04-13T02:36:18Z","git_url":"git://github.com/FuYaoDe/Trademuch.git","ssh_url":"git@github.com:FuYaoDe/Trademuch.git","clone_url":"https://github.com/FuYaoDe/Trademuch.git","svn_url":"https://github.com/FuYaoDe/Trademuch","homepage":null,"size":20996,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"trunk-studio:develop","ref":"develop","sha":"8dede594d70d5666f3c71654d263b67f317790fc","user":{"login":"trunk-studio","id":12459749,"avatar_url":"https://avatars.githubusercontent.com/u/12459749?v=3","gravatar_id":"","url":"https://api.github.com/users/trunk-studio","html_url":"https://github.com/trunk-studio","followers_url":"https://api.github.com/users/trunk-studio/followers","following_url":"https://api.github.com/users/trunk-studio/following{/other_user}","gists_url":"https://api.github.com/users/trunk-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/trunk-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trunk-studio/subscriptions","organizations_url":"https://api.github.com/users/trunk-studio/orgs","repos_url":"https://api.github.com/users/trunk-studio/repos","events_url":"https://api.github.com/users/trunk-studio/events{/privacy}","received_events_url":"https://api.github.com/users/trunk-studio/received_events","type":"Organization","site_admin":false},"repo":{"id":46551565,"name":"trademuch","full_name":"trunk-studio/trademuch","owner":{"login":"trunk-studio","id":12459749,"avatar_url":"https://avatars.githubusercontent.com/u/12459749?v=3","gravatar_id":"","url":"https://api.github.com/users/trunk-studio","html_url":"https://github.com/trunk-studio","followers_url":"https://api.github.com/users/trunk-studio/followers","following_url":"https://api.github.com/users/trunk-studio/following{/other_user}","gists_url":"https://api.github.com/users/trunk-studio/gists{/gist_id}","starred_url":"https://api.github.com/users/trunk-studio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trunk-studio/subscriptions","organizations_url":"https://api.github.com/users/trunk-studio/orgs","repos_url":"https://api.github.com/users/trunk-studio/repos","events_url":"https://api.github.com/users/trunk-studio/events{/privacy}","received_events_url":"https://api.github.com/users/trunk-studio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trunk-studio/trademuch","description":"","fork":true,"url":"https://api.github.com/repos/trunk-studio/trademuch","forks_url":"https://api.github.com/repos/trunk-studio/trademuch/forks","keys_url":"https://api.github.com/repos/trunk-studio/trademuch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trunk-studio/trademuch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trunk-studio/trademuch/teams","hooks_url":"https://api.github.com/repos/trunk-studio/trademuch/hooks","issue_events_url":"https://api.github.com/repos/trunk-studio/trademuch/issues/events{/number}","events_url":"https://api.github.com/repos/trunk-studio/trademuch/events","assignees_url":"https://api.github.com/repos/trunk-studio/trademuch/assignees{/user}","branches_url":"https://api.github.com/repos/trunk-studio/trademuch/branches{/branch}","tags_url":"https://api.github.com/repos/trunk-studio/trademuch/tags","blobs_url":"https://api.github.com/repos/trunk-studio/trademuch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trunk-studio/trademuch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trunk-studio/trademuch/git/refs{/sha}","trees_url":"https://api.github.com/repos/trunk-studio/trademuch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trunk-studio/trademuch/statuses/{sha}","languages_url":"https://api.github.com/repos/trunk-studio/trademuch/languages","stargazers_url":"https://api.github.com/repos/trunk-studio/trademuch/stargazers","contributors_url":"https://api.github.com/repos/trunk-studio/trademuch/contributors","subscribers_url":"https://api.github.com/repos/trunk-studio/trademuch/subscribers","subscription_url":"https://api.github.com/repos/trunk-studio/trademuch/subscription","commits_url":"https://api.github.com/repos/trunk-studio/trademuch/commits{/sha}","git_commits_url":"https://api.github.com/repos/trunk-studio/trademuch/git/commits{/sha}","comments_url":"https://api.github.com/repos/trunk-studio/trademuch/comments{/number}","issue_comment_url":"https://api.github.com/repos/trunk-studio/trademuch/issues/comments{/number}","contents_url":"https://api.github.com/repos/trunk-studio/trademuch/contents/{+path}","compare_url":"https://api.github.com/repos/trunk-studio/trademuch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trunk-studio/trademuch/merges","archive_url":"https://api.github.com/repos/trunk-studio/trademuch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trunk-studio/trademuch/downloads","issues_url":"https://api.github.com/repos/trunk-studio/trademuch/issues{/number}","pulls_url":"https://api.github.com/repos/trunk-studio/trademuch/pulls{/number}","milestones_url":"https://api.github.com/repos/trunk-studio/trademuch/milestones{/number}","notifications_url":"https://api.github.com/repos/trunk-studio/trademuch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trunk-studio/trademuch/labels{/name}","releases_url":"https://api.github.com/repos/trunk-studio/trademuch/releases{/id}","deployments_url":"https://api.github.com/repos/trunk-studio/trademuch/deployments","created_at":"2015-11-20T09:12:18Z","updated_at":"2016-03-07T15:56:37Z","pushed_at":"2016-04-13T02:49:52Z","git_url":"git://github.com/trunk-studio/trademuch.git","ssh_url":"git@github.com:trunk-studio/trademuch.git","clone_url":"https://github.com/trunk-studio/trademuch.git","svn_url":"https://github.com/trunk-studio/trademuch","homepage":null,"size":20993,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":51,"forks":7,"open_issues":51,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535"},"html":{"href":"https://github.com/trunk-studio/trademuch/pull/535"},"issue":{"href":"https://api.github.com/repos/trunk-studio/trademuch/issues/535"},"comments":{"href":"https://api.github.com/repos/trunk-studio/trademuch/issues/535/comments"},"review_comments":{"href":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535/comments"},"review_comment":{"href":"https://api.github.com/repos/trunk-studio/trademuch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trunk-studio/trademuch/pulls/535/commits"},"statuses":{"href":"https://api.github.com/repos/trunk-studio/trademuch/statuses/28933f9b688040bf7b9fcc26c82740ec10953c0c"}}}}