{"action":"created","comment":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/comments/25015858","id":25015858,"diff_hunk":"@@ -59,6 +59,12 @@\n \t\t\"view-more\": \"View more\",\n \t\t\"wikia-map-view-map\": \"View\",\n \t\t\"search-label\": \"Search\",\n-\t\t\"cancel-label\": \"Cancel\"\n+\t\t\"cancel-label\": \"Cancel\",\n+\t\t\"enter-login-label\": \"Enter login\",\n+\t\t\"enter-password-label\": \"Enter password\",\n+\t\t\"logout\": \"Logout\",","path":"front/locales/en/translation.json","position":8,"original_position":8,"commit_id":"2f8d2f848eab52eca569e8ce337ff954a0ac8106","original_commit_id":"2f8d2f848eab52eca569e8ce337ff954a0ac8106","user":{"login":"mklucsarits","id":5031923,"avatar_url":"https://avatars.githubusercontent.com/u/5031923?v=3","gravatar_id":"","url":"https://api.github.com/users/mklucsarits","html_url":"https://github.com/mklucsarits","followers_url":"https://api.github.com/users/mklucsarits/followers","following_url":"https://api.github.com/users/mklucsarits/following{/other_user}","gists_url":"https://api.github.com/users/mklucsarits/gists{/gist_id}","starred_url":"https://api.github.com/users/mklucsarits/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mklucsarits/subscriptions","organizations_url":"https://api.github.com/users/mklucsarits/orgs","repos_url":"https://api.github.com/users/mklucsarits/repos","events_url":"https://api.github.com/users/mklucsarits/events{/privacy}","received_events_url":"https://api.github.com/users/mklucsarits/received_events","type":"User","site_admin":false},"body":"Logout and Login should not be used as verbs. It should be \"Log out\" and \"Log in\".","created_at":"2015-02-19T19:17:27Z","updated_at":"2015-02-19T19:17:27Z","html_url":"https://github.com/Wikia/mercury/pull/570#discussion_r25015858","pull_request_url":"https://api.github.com/repos/Wikia/mercury/pulls/570","_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments/25015858"},"html":{"href":"https://github.com/Wikia/mercury/pull/570#discussion_r25015858"},"pull_request":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/570"}}},"pull_request":{"url":"https://api.github.com/repos/Wikia/mercury/pulls/570","id":29450652,"html_url":"https://github.com/Wikia/mercury/pull/570","diff_url":"https://github.com/Wikia/mercury/pull/570.diff","patch_url":"https://github.com/Wikia/mercury/pull/570.patch","issue_url":"https://api.github.com/repos/Wikia/mercury/issues/570","number":570,"state":"open","locked":false,"title":"Mercury login","user":{"login":"dianafa","id":3716441,"avatar_url":"https://avatars.githubusercontent.com/u/3716441?v=3","gravatar_id":"","url":"https://api.github.com/users/dianafa","html_url":"https://github.com/dianafa","followers_url":"https://api.github.com/users/dianafa/followers","following_url":"https://api.github.com/users/dianafa/following{/other_user}","gists_url":"https://api.github.com/users/dianafa/gists{/gist_id}","starred_url":"https://api.github.com/users/dianafa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dianafa/subscriptions","organizations_url":"https://api.github.com/users/dianafa/orgs","repos_url":"https://api.github.com/users/dianafa/repos","events_url":"https://api.github.com/users/dianafa/events{/privacy}","received_events_url":"https://api.github.com/users/dianafa/received_events","type":"User","site_admin":false},"body":"tl;dr:\r\nI used Ember Simple Auth.\r\nCurrenty user can login, see his avatar, click on link to his profile, logout.\r\nI wrote also some basic tests.\r\n\r\n---------\r\n\r\nHow does it works:\r\n1. To handle communication with Helios it uses the ember-simple-auth with simple-auth-oauth2 (OAuth) authenticator, since it seems to be the best and still supproted/enhanced library for Ember.js for authentication/authorization.\r\n\r\n2. ember-simple-auth automatically maintains the 'session' variable which is available in all routes, controllers and components.\r\n\r\n3. To keep all login connected functions I've created AuthMixin which I add to SiteHeadComponent. AuthMixin collects data from input and calls simple-auth 'authenticate' function.\r\n\r\n4. Plugin sends POST for '/token' url and then in routes.ts we proxy it to https://id.wikia-services.com/token?CREDENTIALS\r\n\r\nCREDENTIALS look like:\r\n* grant_type=password <- this part is mantained by ember-simple auth by setting:\r\nwindow.ENV['simple-auth'] = {\r\n   authorizer: 'simple-auth-authorizer:oauth2-bearer'\r\n};\r\n\r\n* client_id=MEDIAWIKI_CLIENT_ID\r\n* client_secret=MEDIAWIKI_CLIENT_SECRET\r\nabove two are set as a localSettings in localSettings.ts\r\n\r\n* username=USERNAME\r\n* password=PASS\r\n\r\n6. With received user_id it asks wikia.com/api/v1 for user's username & avatar\r\nhttp://www.wikia.com/api/v1/User/Details?ids=USER_ID","created_at":"2015-02-17T15:30:57Z","updated_at":"2015-02-19T19:17:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Wikia/mercury/pulls/570/commits","review_comments_url":"https://api.github.com/repos/Wikia/mercury/pulls/570/comments","review_comment_url":"https://api.github.com/repos/Wikia/mercury/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Wikia/mercury/issues/570/comments","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/2f8d2f848eab52eca569e8ce337ff954a0ac8106","head":{"label":"Mercury_login","ref":"Mercury_login","sha":"2f8d2f848eab52eca569e8ce337ff954a0ac8106","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments/{number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","created_at":"2014-02-10T21:44:25Z","updated_at":"2015-02-19T15:18:18Z","pushed_at":"2015-02-19T18:22:16Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"http://dev.wikia.com","size":14664,"stargazers_count":8,"watchers_count":8,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":8,"default_branch":"dev"}},"base":{"label":"dev","ref":"dev","sha":"d96f7d51f984687b523fdae6cd843672949ef9f5","user":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"repo":{"id":16710430,"name":"mercury","full_name":"Wikia/mercury","owner":{"login":"Wikia","id":1171011,"avatar_url":"https://avatars.githubusercontent.com/u/1171011?v=3","gravatar_id":"","url":"https://api.github.com/users/Wikia","html_url":"https://github.com/Wikia","followers_url":"https://api.github.com/users/Wikia/followers","following_url":"https://api.github.com/users/Wikia/following{/other_user}","gists_url":"https://api.github.com/users/Wikia/gists{/gist_id}","starred_url":"https://api.github.com/users/Wikia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Wikia/subscriptions","organizations_url":"https://api.github.com/users/Wikia/orgs","repos_url":"https://api.github.com/users/Wikia/repos","events_url":"https://api.github.com/users/Wikia/events{/privacy}","received_events_url":"https://api.github.com/users/Wikia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Wikia/mercury","description":"Wikia Web application","fork":false,"url":"https://api.github.com/repos/Wikia/mercury","forks_url":"https://api.github.com/repos/Wikia/mercury/forks","keys_url":"https://api.github.com/repos/Wikia/mercury/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Wikia/mercury/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Wikia/mercury/teams","hooks_url":"https://api.github.com/repos/Wikia/mercury/hooks","issue_events_url":"https://api.github.com/repos/Wikia/mercury/issues/events{/number}","events_url":"https://api.github.com/repos/Wikia/mercury/events","assignees_url":"https://api.github.com/repos/Wikia/mercury/assignees{/user}","branches_url":"https://api.github.com/repos/Wikia/mercury/branches{/branch}","tags_url":"https://api.github.com/repos/Wikia/mercury/tags","blobs_url":"https://api.github.com/repos/Wikia/mercury/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Wikia/mercury/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Wikia/mercury/git/refs{/sha}","trees_url":"https://api.github.com/repos/Wikia/mercury/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Wikia/mercury/statuses/{sha}","languages_url":"https://api.github.com/repos/Wikia/mercury/languages","stargazers_url":"https://api.github.com/repos/Wikia/mercury/stargazers","contributors_url":"https://api.github.com/repos/Wikia/mercury/contributors","subscribers_url":"https://api.github.com/repos/Wikia/mercury/subscribers","subscription_url":"https://api.github.com/repos/Wikia/mercury/subscription","commits_url":"https://api.github.com/repos/Wikia/mercury/commits{/sha}","git_commits_url":"https://api.github.com/repos/Wikia/mercury/git/commits{/sha}","comments_url":"https://api.github.com/repos/Wikia/mercury/comments{/number}","issue_comment_url":"https://api.github.com/repos/Wikia/mercury/issues/comments/{number}","contents_url":"https://api.github.com/repos/Wikia/mercury/contents/{+path}","compare_url":"https://api.github.com/repos/Wikia/mercury/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Wikia/mercury/merges","archive_url":"https://api.github.com/repos/Wikia/mercury/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Wikia/mercury/downloads","issues_url":"https://api.github.com/repos/Wikia/mercury/issues{/number}","pulls_url":"https://api.github.com/repos/Wikia/mercury/pulls{/number}","milestones_url":"https://api.github.com/repos/Wikia/mercury/milestones{/number}","notifications_url":"https://api.github.com/repos/Wikia/mercury/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Wikia/mercury/labels{/name}","releases_url":"https://api.github.com/repos/Wikia/mercury/releases{/id}","created_at":"2014-02-10T21:44:25Z","updated_at":"2015-02-19T15:18:18Z","pushed_at":"2015-02-19T18:22:16Z","git_url":"git://github.com/Wikia/mercury.git","ssh_url":"git@github.com:Wikia/mercury.git","clone_url":"https://github.com/Wikia/mercury.git","svn_url":"https://github.com/Wikia/mercury","homepage":"http://dev.wikia.com","size":14664,"stargazers_count":8,"watchers_count":8,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":10,"forks":0,"open_issues":10,"watchers":8,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/570"},"html":{"href":"https://github.com/Wikia/mercury/pull/570"},"issue":{"href":"https://api.github.com/repos/Wikia/mercury/issues/570"},"comments":{"href":"https://api.github.com/repos/Wikia/mercury/issues/570/comments"},"review_comments":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/570/comments"},"review_comment":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Wikia/mercury/pulls/570/commits"},"statuses":{"href":"https://api.github.com/repos/Wikia/mercury/statuses/2f8d2f848eab52eca569e8ce337ff954a0ac8106"}}}}