{"action":"created","comment":{"url":"https://api.github.com/repos/almighty/almighty-ui/pulls/comments/80682429","pull_request_review_id":1722510,"id":80682429,"diff_hunk":"@@ -0,0 +1,34 @@\n+import { Injectable } from '@angular/core';\n+import { Router } from \"@angular/router\";\n+import { Logger } from '../shared/logger.service';\n+\n+@Injectable()\n+export class AuthenticationService {\n+  private authToken: any = null;\n+\n+  constructor(private router: Router, private logger: Logger) {\n+    //If a token is passed part of the url - extract that and set it    \n+    if((window.location.href).indexOf('?token=')>0){","path":"src/app/auth/authentication.service.ts","position":11,"original_position":11,"commit_id":"004531365c299512e7c360850d0a8c4e6e884360","original_commit_id":"004531365c299512e7c360850d0a8c4e6e884360","user":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars.githubusercontent.com/u/719616?v=3","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"body":"What if `token` won't come as first query param? Wouldn't it be better to extract all first into some sort of map and get relevant by key?","created_at":"2016-09-27T12:43:57Z","updated_at":"2016-09-27T12:47:04Z","html_url":"https://github.com/almighty/almighty-ui/pull/76#discussion_r80682429","pull_request_url":"https://api.github.com/repos/almighty/almighty-ui/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/almighty/almighty-ui/pulls/comments/80682429"},"html":{"href":"https://github.com/almighty/almighty-ui/pull/76#discussion_r80682429"},"pull_request":{"href":"https://api.github.com/repos/almighty/almighty-ui/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/almighty/almighty-ui/pulls/76","id":84486965,"html_url":"https://github.com/almighty/almighty-ui/pull/76","diff_url":"https://github.com/almighty/almighty-ui/pull/76.diff","patch_url":"https://github.com/almighty/almighty-ui/pull/76.patch","issue_url":"https://api.github.com/repos/almighty/almighty-ui/issues/76","number":76,"state":"open","locked":false,"title":"Added authentication service to check and store (localstorage) a token","user":{"login":"nimishamukherjee","id":1892722,"avatar_url":"https://avatars.githubusercontent.com/u/1892722?v=3","gravatar_id":"","url":"https://api.github.com/users/nimishamukherjee","html_url":"https://github.com/nimishamukherjee","followers_url":"https://api.github.com/users/nimishamukherjee/followers","following_url":"https://api.github.com/users/nimishamukherjee/following{/other_user}","gists_url":"https://api.github.com/users/nimishamukherjee/gists{/gist_id}","starred_url":"https://api.github.com/users/nimishamukherjee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nimishamukherjee/subscriptions","organizations_url":"https://api.github.com/users/nimishamukherjee/orgs","repos_url":"https://api.github.com/users/nimishamukherjee/repos","events_url":"https://api.github.com/users/nimishamukherjee/events{/privacy}","received_events_url":"https://api.github.com/users/nimishamukherjee/received_events","type":"User","site_admin":false},"body":"Added authentication service to check and store (localstorage) a token. On login, the core's authorize API is called which in turns carries out the relevant Git validations and authorization. Core then redirects to the referrer URL with a token. This token gets stored locally and gets  retrieved for subsequent page visits. On logout the token gets cleared.\n\n<!-- Reviewable:start -->\n---\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"34\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/almighty/almighty-ui/76)\n<!-- Reviewable:end -->\n","created_at":"2016-09-08T14:21:50Z","updated_at":"2016-09-27T12:47:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aee1fe1c589ac3c2f0238e6c2ee3a8f18eac86cf","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/almighty/almighty-ui/pulls/76/commits","review_comments_url":"https://api.github.com/repos/almighty/almighty-ui/pulls/76/comments","review_comment_url":"https://api.github.com/repos/almighty/almighty-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/almighty/almighty-ui/issues/76/comments","statuses_url":"https://api.github.com/repos/almighty/almighty-ui/statuses/004531365c299512e7c360850d0a8c4e6e884360","head":{"label":"nimishamukherjee:almighty-ui-gitlogin","ref":"almighty-ui-gitlogin","sha":"004531365c299512e7c360850d0a8c4e6e884360","user":{"login":"nimishamukherjee","id":1892722,"avatar_url":"https://avatars.githubusercontent.com/u/1892722?v=3","gravatar_id":"","url":"https://api.github.com/users/nimishamukherjee","html_url":"https://github.com/nimishamukherjee","followers_url":"https://api.github.com/users/nimishamukherjee/followers","following_url":"https://api.github.com/users/nimishamukherjee/following{/other_user}","gists_url":"https://api.github.com/users/nimishamukherjee/gists{/gist_id}","starred_url":"https://api.github.com/users/nimishamukherjee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nimishamukherjee/subscriptions","organizations_url":"https://api.github.com/users/nimishamukherjee/orgs","repos_url":"https://api.github.com/users/nimishamukherjee/repos","events_url":"https://api.github.com/users/nimishamukherjee/events{/privacy}","received_events_url":"https://api.github.com/users/nimishamukherjee/received_events","type":"User","site_admin":false},"repo":{"id":64994054,"name":"almighty-ui","full_name":"nimishamukherjee/almighty-ui","owner":{"login":"nimishamukherjee","id":1892722,"avatar_url":"https://avatars.githubusercontent.com/u/1892722?v=3","gravatar_id":"","url":"https://api.github.com/users/nimishamukherjee","html_url":"https://github.com/nimishamukherjee","followers_url":"https://api.github.com/users/nimishamukherjee/followers","following_url":"https://api.github.com/users/nimishamukherjee/following{/other_user}","gists_url":"https://api.github.com/users/nimishamukherjee/gists{/gist_id}","starred_url":"https://api.github.com/users/nimishamukherjee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nimishamukherjee/subscriptions","organizations_url":"https://api.github.com/users/nimishamukherjee/orgs","repos_url":"https://api.github.com/users/nimishamukherjee/repos","events_url":"https://api.github.com/users/nimishamukherjee/events{/privacy}","received_events_url":"https://api.github.com/users/nimishamukherjee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nimishamukherjee/almighty-ui","description":null,"fork":true,"url":"https://api.github.com/repos/nimishamukherjee/almighty-ui","forks_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/forks","keys_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/teams","hooks_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/hooks","issue_events_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/issues/events{/number}","events_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/events","assignees_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/assignees{/user}","branches_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/branches{/branch}","tags_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/tags","blobs_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/languages","stargazers_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/stargazers","contributors_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/contributors","subscribers_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/subscribers","subscription_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/subscription","commits_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/contents/{+path}","compare_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/merges","archive_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/downloads","issues_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/issues{/number}","pulls_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/labels{/name}","releases_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/releases{/id}","deployments_url":"https://api.github.com/repos/nimishamukherjee/almighty-ui/deployments","created_at":"2016-08-05T06:23:48Z","updated_at":"2016-08-30T13:56:24Z","pushed_at":"2016-09-26T05:24:55Z","git_url":"git://github.com/nimishamukherjee/almighty-ui.git","ssh_url":"git@github.com:nimishamukherjee/almighty-ui.git","clone_url":"https://github.com/nimishamukherjee/almighty-ui.git","svn_url":"https://github.com/nimishamukherjee/almighty-ui","homepage":null,"size":578,"stargazers_count":0,"watchers_count":0,"language":"CSS","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":"almighty:master","ref":"master","sha":"cf630b370e3685abdb2a3b94690ed234c15c31fc","user":{"login":"almighty","id":17783151,"avatar_url":"https://avatars.githubusercontent.com/u/17783151?v=3","gravatar_id":"","url":"https://api.github.com/users/almighty","html_url":"https://github.com/almighty","followers_url":"https://api.github.com/users/almighty/followers","following_url":"https://api.github.com/users/almighty/following{/other_user}","gists_url":"https://api.github.com/users/almighty/gists{/gist_id}","starred_url":"https://api.github.com/users/almighty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almighty/subscriptions","organizations_url":"https://api.github.com/users/almighty/orgs","repos_url":"https://api.github.com/users/almighty/repos","events_url":"https://api.github.com/users/almighty/events{/privacy}","received_events_url":"https://api.github.com/users/almighty/received_events","type":"Organization","site_admin":false},"repo":{"id":63066512,"name":"almighty-ui","full_name":"almighty/almighty-ui","owner":{"login":"almighty","id":17783151,"avatar_url":"https://avatars.githubusercontent.com/u/17783151?v=3","gravatar_id":"","url":"https://api.github.com/users/almighty","html_url":"https://github.com/almighty","followers_url":"https://api.github.com/users/almighty/followers","following_url":"https://api.github.com/users/almighty/following{/other_user}","gists_url":"https://api.github.com/users/almighty/gists{/gist_id}","starred_url":"https://api.github.com/users/almighty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/almighty/subscriptions","organizations_url":"https://api.github.com/users/almighty/orgs","repos_url":"https://api.github.com/users/almighty/repos","events_url":"https://api.github.com/users/almighty/events{/privacy}","received_events_url":"https://api.github.com/users/almighty/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/almighty/almighty-ui","description":null,"fork":false,"url":"https://api.github.com/repos/almighty/almighty-ui","forks_url":"https://api.github.com/repos/almighty/almighty-ui/forks","keys_url":"https://api.github.com/repos/almighty/almighty-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/almighty/almighty-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/almighty/almighty-ui/teams","hooks_url":"https://api.github.com/repos/almighty/almighty-ui/hooks","issue_events_url":"https://api.github.com/repos/almighty/almighty-ui/issues/events{/number}","events_url":"https://api.github.com/repos/almighty/almighty-ui/events","assignees_url":"https://api.github.com/repos/almighty/almighty-ui/assignees{/user}","branches_url":"https://api.github.com/repos/almighty/almighty-ui/branches{/branch}","tags_url":"https://api.github.com/repos/almighty/almighty-ui/tags","blobs_url":"https://api.github.com/repos/almighty/almighty-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/almighty/almighty-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/almighty/almighty-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/almighty/almighty-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/almighty/almighty-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/almighty/almighty-ui/languages","stargazers_url":"https://api.github.com/repos/almighty/almighty-ui/stargazers","contributors_url":"https://api.github.com/repos/almighty/almighty-ui/contributors","subscribers_url":"https://api.github.com/repos/almighty/almighty-ui/subscribers","subscription_url":"https://api.github.com/repos/almighty/almighty-ui/subscription","commits_url":"https://api.github.com/repos/almighty/almighty-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/almighty/almighty-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/almighty/almighty-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/almighty/almighty-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/almighty/almighty-ui/contents/{+path}","compare_url":"https://api.github.com/repos/almighty/almighty-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/almighty/almighty-ui/merges","archive_url":"https://api.github.com/repos/almighty/almighty-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/almighty/almighty-ui/downloads","issues_url":"https://api.github.com/repos/almighty/almighty-ui/issues{/number}","pulls_url":"https://api.github.com/repos/almighty/almighty-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/almighty/almighty-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/almighty/almighty-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/almighty/almighty-ui/labels{/name}","releases_url":"https://api.github.com/repos/almighty/almighty-ui/releases{/id}","deployments_url":"https://api.github.com/repos/almighty/almighty-ui/deployments","created_at":"2016-07-11T12:36:20Z","updated_at":"2016-09-27T08:57:32Z","pushed_at":"2016-09-27T11:51:17Z","git_url":"git://github.com/almighty/almighty-ui.git","ssh_url":"git@github.com:almighty/almighty-ui.git","clone_url":"https://github.com/almighty/almighty-ui.git","svn_url":"https://github.com/almighty/almighty-ui","homepage":"http://devdoc.almighty.io/","size":2107,"stargazers_count":5,"watchers_count":5,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":39,"forks":15,"open_issues":39,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/almighty/almighty-ui/pulls/76"},"html":{"href":"https://github.com/almighty/almighty-ui/pull/76"},"issue":{"href":"https://api.github.com/repos/almighty/almighty-ui/issues/76"},"comments":{"href":"https://api.github.com/repos/almighty/almighty-ui/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/almighty/almighty-ui/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/almighty/almighty-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/almighty/almighty-ui/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/almighty/almighty-ui/statuses/004531365c299512e7c360850d0a8c4e6e884360"}}}}
{"actor":{"display_login":"bartoszmajsak"}}