{"action":"created","comment":{"url":"https://api.github.com/repos/draw-dev/DRAW/pulls/comments/126602322","pull_request_review_id":49100381,"id":126602322,"diff_hunk":"@@ -55,35 +50,55 @@ abstract class Authenticator {\n     if (credentials == null) {\n       return;\n     }\n-    String accessToken = credentials.accessToken;\n-    Map<String, String> revokeAccess = new Map<String, String>();\n-    revokeAccess[kTokenKey] = accessToken;\n-    revokeAccess[kTokenTypeHintKey] = 'access_token';\n+    List<Map> tokens = new List<Map>();\n+    Map accessToken = {\n+      kTokenKey: credentials.accessToken,\n+      kTokenTypeHintKey: 'access_token',\n+    };\n+    tokens.add(accessToken);\n+\n+    if (credentials.refreshToken != null) {\n+      Map refreshToken = {\n+        kTokenKey: credentials.refreshToken,\n+        kTokenTypeHintKey: 'refresh_token',\n+      };\n+      tokens.add(refreshToken);\n+    }\n \n-    // Retrieve the client ID and secret.\n-    String clientId = _grant.identifier;\n-    String clientSecret = _grant.secret;\n+    for (int i = 0; i < tokens.length; i++) {\n+      String token = tokens[i][kTokenKey];\n+      String tokenType = tokens[i][kTokenTypeHintKey];\n+      Map<String, String> revokeAccess = new Map<String, String>();\n+      revokeAccess[kTokenKey] = token;\n+      revokeAccess[kTokenTypeHintKey] = tokenType;\n \n-    // TODO(bkonyi) handle cases where clientSecret isn't used.\n-    String userInfo = '$clientId:$clientSecret';\n+      // TODO(bkonyi) we shouldn't have hardcoded urls like this. Move to common\n+      // file with all API related strings.\n+      Uri path = Uri.parse(r'https://www.reddit.com/api/v1/revoke_token');","path":"lib/src/auth.dart","position":49,"original_position":49,"commit_id":"80648b29cfe05384f6aeebc361aebc94a165e886","original_commit_id":"80648b29cfe05384f6aeebc361aebc94a165e886","user":{"login":"leonsenft","id":1916163,"avatar_url":"https://avatars3.githubusercontent.com/u/1916163?v=3","gravatar_id":"","url":"https://api.github.com/users/leonsenft","html_url":"https://github.com/leonsenft","followers_url":"https://api.github.com/users/leonsenft/followers","following_url":"https://api.github.com/users/leonsenft/following{/other_user}","gists_url":"https://api.github.com/users/leonsenft/gists{/gist_id}","starred_url":"https://api.github.com/users/leonsenft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leonsenft/subscriptions","organizations_url":"https://api.github.com/users/leonsenft/orgs","repos_url":"https://api.github.com/users/leonsenft/repos","events_url":"https://api.github.com/users/leonsenft/events{/privacy}","received_events_url":"https://api.github.com/users/leonsenft/received_events","type":"User","site_admin":false},"body":"Avoid LHS type unless it's unclear from context or type inference doesn't infer the desired type. ","created_at":"2017-07-11T06:02:31Z","updated_at":"2017-07-11T06:02:32Z","html_url":"https://github.com/draw-dev/DRAW/pull/5#discussion_r126602322","pull_request_url":"https://api.github.com/repos/draw-dev/DRAW/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/draw-dev/DRAW/pulls/comments/126602322"},"html":{"href":"https://github.com/draw-dev/DRAW/pull/5#discussion_r126602322"},"pull_request":{"href":"https://api.github.com/repos/draw-dev/DRAW/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/draw-dev/DRAW/pulls/5","id":129504705,"html_url":"https://github.com/draw-dev/DRAW/pull/5","diff_url":"https://github.com/draw-dev/DRAW/pull/5.diff","patch_url":"https://github.com/draw-dev/DRAW/pull/5.patch","issue_url":"https://api.github.com/repos/draw-dev/DRAW/issues/5","number":5,"state":"open","locked":false,"title":"Added [WebAuthenticator], which allows for user authentication through a browser","user":{"login":"bkonyi","id":24210656,"avatar_url":"https://avatars1.githubusercontent.com/u/24210656?v=3","gravatar_id":"","url":"https://api.github.com/users/bkonyi","html_url":"https://github.com/bkonyi","followers_url":"https://api.github.com/users/bkonyi/followers","following_url":"https://api.github.com/users/bkonyi/following{/other_user}","gists_url":"https://api.github.com/users/bkonyi/gists{/gist_id}","starred_url":"https://api.github.com/users/bkonyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bkonyi/subscriptions","organizations_url":"https://api.github.com/users/bkonyi/orgs","repos_url":"https://api.github.com/users/bkonyi/repos","events_url":"https://api.github.com/users/bkonyi/events{/privacy}","received_events_url":"https://api.github.com/users/bkonyi/received_events","type":"User","site_admin":false},"body":"Added [WebAuthenticator], which allows for user authentication at https://www.reddit.com/api/v1/authorize. Authentication + authorization have been tested, but nothing else at the moment.","created_at":"2017-07-07T23:24:17Z","updated_at":"2017-07-11T06:02:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb951fc900daae1398e740fce1121660d3935849","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/draw-dev/DRAW/pulls/5/commits","review_comments_url":"https://api.github.com/repos/draw-dev/DRAW/pulls/5/comments","review_comment_url":"https://api.github.com/repos/draw-dev/DRAW/pulls/comments{/number}","comments_url":"https://api.github.com/repos/draw-dev/DRAW/issues/5/comments","statuses_url":"https://api.github.com/repos/draw-dev/DRAW/statuses/80648b29cfe05384f6aeebc361aebc94a165e886","head":{"label":"draw-dev:dev","ref":"dev","sha":"80648b29cfe05384f6aeebc361aebc94a165e886","user":{"login":"draw-dev","id":28206677,"avatar_url":"https://avatars1.githubusercontent.com/u/28206677?v=3","gravatar_id":"","url":"https://api.github.com/users/draw-dev","html_url":"https://github.com/draw-dev","followers_url":"https://api.github.com/users/draw-dev/followers","following_url":"https://api.github.com/users/draw-dev/following{/other_user}","gists_url":"https://api.github.com/users/draw-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/draw-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/draw-dev/subscriptions","organizations_url":"https://api.github.com/users/draw-dev/orgs","repos_url":"https://api.github.com/users/draw-dev/repos","events_url":"https://api.github.com/users/draw-dev/events{/privacy}","received_events_url":"https://api.github.com/users/draw-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":89817717,"name":"DRAW","full_name":"draw-dev/DRAW","owner":{"login":"draw-dev","id":28206677,"avatar_url":"https://avatars1.githubusercontent.com/u/28206677?v=3","gravatar_id":"","url":"https://api.github.com/users/draw-dev","html_url":"https://github.com/draw-dev","followers_url":"https://api.github.com/users/draw-dev/followers","following_url":"https://api.github.com/users/draw-dev/following{/other_user}","gists_url":"https://api.github.com/users/draw-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/draw-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/draw-dev/subscriptions","organizations_url":"https://api.github.com/users/draw-dev/orgs","repos_url":"https://api.github.com/users/draw-dev/repos","events_url":"https://api.github.com/users/draw-dev/events{/privacy}","received_events_url":"https://api.github.com/users/draw-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/draw-dev/DRAW","description":"DRAW: The Dart Reddit API Wrapper","fork":false,"url":"https://api.github.com/repos/draw-dev/DRAW","forks_url":"https://api.github.com/repos/draw-dev/DRAW/forks","keys_url":"https://api.github.com/repos/draw-dev/DRAW/keys{/key_id}","collaborators_url":"https://api.github.com/repos/draw-dev/DRAW/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/draw-dev/DRAW/teams","hooks_url":"https://api.github.com/repos/draw-dev/DRAW/hooks","issue_events_url":"https://api.github.com/repos/draw-dev/DRAW/issues/events{/number}","events_url":"https://api.github.com/repos/draw-dev/DRAW/events","assignees_url":"https://api.github.com/repos/draw-dev/DRAW/assignees{/user}","branches_url":"https://api.github.com/repos/draw-dev/DRAW/branches{/branch}","tags_url":"https://api.github.com/repos/draw-dev/DRAW/tags","blobs_url":"https://api.github.com/repos/draw-dev/DRAW/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/draw-dev/DRAW/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/draw-dev/DRAW/git/refs{/sha}","trees_url":"https://api.github.com/repos/draw-dev/DRAW/git/trees{/sha}","statuses_url":"https://api.github.com/repos/draw-dev/DRAW/statuses/{sha}","languages_url":"https://api.github.com/repos/draw-dev/DRAW/languages","stargazers_url":"https://api.github.com/repos/draw-dev/DRAW/stargazers","contributors_url":"https://api.github.com/repos/draw-dev/DRAW/contributors","subscribers_url":"https://api.github.com/repos/draw-dev/DRAW/subscribers","subscription_url":"https://api.github.com/repos/draw-dev/DRAW/subscription","commits_url":"https://api.github.com/repos/draw-dev/DRAW/commits{/sha}","git_commits_url":"https://api.github.com/repos/draw-dev/DRAW/git/commits{/sha}","comments_url":"https://api.github.com/repos/draw-dev/DRAW/comments{/number}","issue_comment_url":"https://api.github.com/repos/draw-dev/DRAW/issues/comments{/number}","contents_url":"https://api.github.com/repos/draw-dev/DRAW/contents/{+path}","compare_url":"https://api.github.com/repos/draw-dev/DRAW/compare/{base}...{head}","merges_url":"https://api.github.com/repos/draw-dev/DRAW/merges","archive_url":"https://api.github.com/repos/draw-dev/DRAW/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/draw-dev/DRAW/downloads","issues_url":"https://api.github.com/repos/draw-dev/DRAW/issues{/number}","pulls_url":"https://api.github.com/repos/draw-dev/DRAW/pulls{/number}","milestones_url":"https://api.github.com/repos/draw-dev/DRAW/milestones{/number}","notifications_url":"https://api.github.com/repos/draw-dev/DRAW/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/draw-dev/DRAW/labels{/name}","releases_url":"https://api.github.com/repos/draw-dev/DRAW/releases{/id}","deployments_url":"https://api.github.com/repos/draw-dev/DRAW/deployments","created_at":"2017-04-29T23:04:07Z","updated_at":"2017-06-20T04:21:10Z","pushed_at":"2017-07-08T23:52:01Z","git_url":"git://github.com/draw-dev/DRAW.git","ssh_url":"git@github.com:draw-dev/DRAW.git","clone_url":"https://github.com/draw-dev/DRAW.git","svn_url":"https://github.com/draw-dev/DRAW","homepage":null,"size":23,"stargazers_count":5,"watchers_count":5,"language":"Dart","has_issues":true,"has_projects":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":5,"default_branch":"master"}},"base":{"label":"draw-dev:master","ref":"master","sha":"596700b57ec10494a5c2d7b38938558061e7173f","user":{"login":"draw-dev","id":28206677,"avatar_url":"https://avatars1.githubusercontent.com/u/28206677?v=3","gravatar_id":"","url":"https://api.github.com/users/draw-dev","html_url":"https://github.com/draw-dev","followers_url":"https://api.github.com/users/draw-dev/followers","following_url":"https://api.github.com/users/draw-dev/following{/other_user}","gists_url":"https://api.github.com/users/draw-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/draw-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/draw-dev/subscriptions","organizations_url":"https://api.github.com/users/draw-dev/orgs","repos_url":"https://api.github.com/users/draw-dev/repos","events_url":"https://api.github.com/users/draw-dev/events{/privacy}","received_events_url":"https://api.github.com/users/draw-dev/received_events","type":"Organization","site_admin":false},"repo":{"id":89817717,"name":"DRAW","full_name":"draw-dev/DRAW","owner":{"login":"draw-dev","id":28206677,"avatar_url":"https://avatars1.githubusercontent.com/u/28206677?v=3","gravatar_id":"","url":"https://api.github.com/users/draw-dev","html_url":"https://github.com/draw-dev","followers_url":"https://api.github.com/users/draw-dev/followers","following_url":"https://api.github.com/users/draw-dev/following{/other_user}","gists_url":"https://api.github.com/users/draw-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/draw-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/draw-dev/subscriptions","organizations_url":"https://api.github.com/users/draw-dev/orgs","repos_url":"https://api.github.com/users/draw-dev/repos","events_url":"https://api.github.com/users/draw-dev/events{/privacy}","received_events_url":"https://api.github.com/users/draw-dev/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/draw-dev/DRAW","description":"DRAW: The Dart Reddit API Wrapper","fork":false,"url":"https://api.github.com/repos/draw-dev/DRAW","forks_url":"https://api.github.com/repos/draw-dev/DRAW/forks","keys_url":"https://api.github.com/repos/draw-dev/DRAW/keys{/key_id}","collaborators_url":"https://api.github.com/repos/draw-dev/DRAW/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/draw-dev/DRAW/teams","hooks_url":"https://api.github.com/repos/draw-dev/DRAW/hooks","issue_events_url":"https://api.github.com/repos/draw-dev/DRAW/issues/events{/number}","events_url":"https://api.github.com/repos/draw-dev/DRAW/events","assignees_url":"https://api.github.com/repos/draw-dev/DRAW/assignees{/user}","branches_url":"https://api.github.com/repos/draw-dev/DRAW/branches{/branch}","tags_url":"https://api.github.com/repos/draw-dev/DRAW/tags","blobs_url":"https://api.github.com/repos/draw-dev/DRAW/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/draw-dev/DRAW/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/draw-dev/DRAW/git/refs{/sha}","trees_url":"https://api.github.com/repos/draw-dev/DRAW/git/trees{/sha}","statuses_url":"https://api.github.com/repos/draw-dev/DRAW/statuses/{sha}","languages_url":"https://api.github.com/repos/draw-dev/DRAW/languages","stargazers_url":"https://api.github.com/repos/draw-dev/DRAW/stargazers","contributors_url":"https://api.github.com/repos/draw-dev/DRAW/contributors","subscribers_url":"https://api.github.com/repos/draw-dev/DRAW/subscribers","subscription_url":"https://api.github.com/repos/draw-dev/DRAW/subscription","commits_url":"https://api.github.com/repos/draw-dev/DRAW/commits{/sha}","git_commits_url":"https://api.github.com/repos/draw-dev/DRAW/git/commits{/sha}","comments_url":"https://api.github.com/repos/draw-dev/DRAW/comments{/number}","issue_comment_url":"https://api.github.com/repos/draw-dev/DRAW/issues/comments{/number}","contents_url":"https://api.github.com/repos/draw-dev/DRAW/contents/{+path}","compare_url":"https://api.github.com/repos/draw-dev/DRAW/compare/{base}...{head}","merges_url":"https://api.github.com/repos/draw-dev/DRAW/merges","archive_url":"https://api.github.com/repos/draw-dev/DRAW/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/draw-dev/DRAW/downloads","issues_url":"https://api.github.com/repos/draw-dev/DRAW/issues{/number}","pulls_url":"https://api.github.com/repos/draw-dev/DRAW/pulls{/number}","milestones_url":"https://api.github.com/repos/draw-dev/DRAW/milestones{/number}","notifications_url":"https://api.github.com/repos/draw-dev/DRAW/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/draw-dev/DRAW/labels{/name}","releases_url":"https://api.github.com/repos/draw-dev/DRAW/releases{/id}","deployments_url":"https://api.github.com/repos/draw-dev/DRAW/deployments","created_at":"2017-04-29T23:04:07Z","updated_at":"2017-06-20T04:21:10Z","pushed_at":"2017-07-08T23:52:01Z","git_url":"git://github.com/draw-dev/DRAW.git","ssh_url":"git@github.com:draw-dev/DRAW.git","clone_url":"https://github.com/draw-dev/DRAW.git","svn_url":"https://github.com/draw-dev/DRAW","homepage":null,"size":23,"stargazers_count":5,"watchers_count":5,"language":"Dart","has_issues":true,"has_projects":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":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/draw-dev/DRAW/pulls/5"},"html":{"href":"https://github.com/draw-dev/DRAW/pull/5"},"issue":{"href":"https://api.github.com/repos/draw-dev/DRAW/issues/5"},"comments":{"href":"https://api.github.com/repos/draw-dev/DRAW/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/draw-dev/DRAW/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/draw-dev/DRAW/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/draw-dev/DRAW/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/draw-dev/DRAW/statuses/80648b29cfe05384f6aeebc361aebc94a165e886"}}}}
{"actor":{"display_login":"leonsenft"}}