{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments/64975467","id":64975467,"diff_hunk":"@@ -128,6 +128,17 @@ export function isSignedIn(): boolean {\n   return (process.env.DATALAB_ENV != 'local' || fs.existsSync(appCredFile));\n }\n \n+function setOauth2Client(parsed_url: any): void {\n+  if (!oauth2Client) {\n+    var OAuth2:any = google.auth.OAuth2;\n+    // TODO(ojarjur): Ideally, we would get the host and port from the parsed_url\n+    // rather than hard-coding them. However, the client ID and secret we are using\n+    // are limited to localhost only. We should consider making this configurable, or\n+    // using the OAuth flow for non-web applications.\n+    oauth2Client = new OAuth2(clientId, clientSecret, 'http://localhost:8081/oauthcallback');","path":"sources/web/datalab/auth.ts","position":11,"original_position":11,"commit_id":"13798d588e0b4eb34053c6ac64c8a907ce054abe","original_commit_id":"13798d588e0b4eb34053c6ac64c8a907ce054abe","user":{"login":"qimingj","id":13439553,"avatar_url":"https://avatars.githubusercontent.com/u/13439553?v=3","gravatar_id":"","url":"https://api.github.com/users/qimingj","html_url":"https://github.com/qimingj","followers_url":"https://api.github.com/users/qimingj/followers","following_url":"https://api.github.com/users/qimingj/following{/other_user}","gists_url":"https://api.github.com/users/qimingj/gists{/gist_id}","starred_url":"https://api.github.com/users/qimingj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qimingj/subscriptions","organizations_url":"https://api.github.com/users/qimingj/orgs","repos_url":"https://api.github.com/users/qimingj/repos","events_url":"https://api.github.com/users/qimingj/events{/privacy}","received_events_url":"https://api.github.com/users/qimingj/received_events","type":"User","site_admin":false},"body":"Good point. I think we are restricted on the the callback url. The port might be changed but it seems it won't be changed at run time. If someday we want to pass in a port number, we can have a init() function which takes the port as parameter. Thoughts?","created_at":"2016-05-27T22:49:13Z","updated_at":"2016-05-27T22:49:13Z","html_url":"https://github.com/GoogleCloudPlatform/datalab/pull/864#discussion_r64975467","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments/64975467"},"html":{"href":"https://github.com/GoogleCloudPlatform/datalab/pull/864#discussion_r64975467"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864","id":71757909,"html_url":"https://github.com/GoogleCloudPlatform/datalab/pull/864","diff_url":"https://github.com/GoogleCloudPlatform/datalab/pull/864.diff","patch_url":"https://github.com/GoogleCloudPlatform/datalab/pull/864.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/864","number":864,"state":"open","locked":false,"title":"Fix two issues that prevented logging in from a local instance.","user":{"login":"ojarjur","id":3039877,"avatar_url":"https://avatars.githubusercontent.com/u/3039877?v=3","gravatar_id":"","url":"https://api.github.com/users/ojarjur","html_url":"https://github.com/ojarjur","followers_url":"https://api.github.com/users/ojarjur/followers","following_url":"https://api.github.com/users/ojarjur/following{/other_user}","gists_url":"https://api.github.com/users/ojarjur/gists{/gist_id}","starred_url":"https://api.github.com/users/ojarjur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojarjur/subscriptions","organizations_url":"https://api.github.com/users/ojarjur/orgs","repos_url":"https://api.github.com/users/ojarjur/repos","events_url":"https://api.github.com/users/ojarjur/events{/privacy}","received_events_url":"https://api.github.com/users/ojarjur/received_events","type":"User","site_admin":false},"body":"The first issue was around the creation of the .config directory.\r\nWe had code in multiple places that tried to create it, and in one\r\nof those cases it tried to create that directory repeatedly, resulting\r\nin failure messages in the logs after the first attempt.\r\n\r\nThis change fixes that by making sure that only the EULA accepted\r\nhandler creates that directory, and only in the case that it does\r\nnot already exist.\r\n\r\nThe other issue was the OAuth callback handler, which did not make\r\nsure the OAuth client instance existed before attempting to use it.\r\n\r\nThis change fixes that by adding that check.","created_at":"2016-05-27T18:57:19Z","updated_at":"2016-05-27T22:49:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e14d99d1e0c53f25299222ab1bf29be25b009e79","assignee":{"login":"qimingj","id":13439553,"avatar_url":"https://avatars.githubusercontent.com/u/13439553?v=3","gravatar_id":"","url":"https://api.github.com/users/qimingj","html_url":"https://github.com/qimingj","followers_url":"https://api.github.com/users/qimingj/followers","following_url":"https://api.github.com/users/qimingj/following{/other_user}","gists_url":"https://api.github.com/users/qimingj/gists{/gist_id}","starred_url":"https://api.github.com/users/qimingj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qimingj/subscriptions","organizations_url":"https://api.github.com/users/qimingj/orgs","repos_url":"https://api.github.com/users/qimingj/repos","events_url":"https://api.github.com/users/qimingj/events{/privacy}","received_events_url":"https://api.github.com/users/qimingj/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/864/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/statuses/13798d588e0b4eb34053c6ac64c8a907ce054abe","head":{"label":"ojarjur:ojarjur/fix-login","ref":"ojarjur/fix-login","sha":"13798d588e0b4eb34053c6ac64c8a907ce054abe","user":{"login":"ojarjur","id":3039877,"avatar_url":"https://avatars.githubusercontent.com/u/3039877?v=3","gravatar_id":"","url":"https://api.github.com/users/ojarjur","html_url":"https://github.com/ojarjur","followers_url":"https://api.github.com/users/ojarjur/followers","following_url":"https://api.github.com/users/ojarjur/following{/other_user}","gists_url":"https://api.github.com/users/ojarjur/gists{/gist_id}","starred_url":"https://api.github.com/users/ojarjur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojarjur/subscriptions","organizations_url":"https://api.github.com/users/ojarjur/orgs","repos_url":"https://api.github.com/users/ojarjur/repos","events_url":"https://api.github.com/users/ojarjur/events{/privacy}","received_events_url":"https://api.github.com/users/ojarjur/received_events","type":"User","site_admin":false},"repo":{"id":59162464,"name":"datalab","full_name":"ojarjur/datalab","owner":{"login":"ojarjur","id":3039877,"avatar_url":"https://avatars.githubusercontent.com/u/3039877?v=3","gravatar_id":"","url":"https://api.github.com/users/ojarjur","html_url":"https://github.com/ojarjur","followers_url":"https://api.github.com/users/ojarjur/followers","following_url":"https://api.github.com/users/ojarjur/following{/other_user}","gists_url":"https://api.github.com/users/ojarjur/gists{/gist_id}","starred_url":"https://api.github.com/users/ojarjur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ojarjur/subscriptions","organizations_url":"https://api.github.com/users/ojarjur/orgs","repos_url":"https://api.github.com/users/ojarjur/repos","events_url":"https://api.github.com/users/ojarjur/events{/privacy}","received_events_url":"https://api.github.com/users/ojarjur/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ojarjur/datalab","description":"Interactive tools and developer experiences for Big Data on Google Cloud Platform.","fork":true,"url":"https://api.github.com/repos/ojarjur/datalab","forks_url":"https://api.github.com/repos/ojarjur/datalab/forks","keys_url":"https://api.github.com/repos/ojarjur/datalab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ojarjur/datalab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ojarjur/datalab/teams","hooks_url":"https://api.github.com/repos/ojarjur/datalab/hooks","issue_events_url":"https://api.github.com/repos/ojarjur/datalab/issues/events{/number}","events_url":"https://api.github.com/repos/ojarjur/datalab/events","assignees_url":"https://api.github.com/repos/ojarjur/datalab/assignees{/user}","branches_url":"https://api.github.com/repos/ojarjur/datalab/branches{/branch}","tags_url":"https://api.github.com/repos/ojarjur/datalab/tags","blobs_url":"https://api.github.com/repos/ojarjur/datalab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ojarjur/datalab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ojarjur/datalab/git/refs{/sha}","trees_url":"https://api.github.com/repos/ojarjur/datalab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ojarjur/datalab/statuses/{sha}","languages_url":"https://api.github.com/repos/ojarjur/datalab/languages","stargazers_url":"https://api.github.com/repos/ojarjur/datalab/stargazers","contributors_url":"https://api.github.com/repos/ojarjur/datalab/contributors","subscribers_url":"https://api.github.com/repos/ojarjur/datalab/subscribers","subscription_url":"https://api.github.com/repos/ojarjur/datalab/subscription","commits_url":"https://api.github.com/repos/ojarjur/datalab/commits{/sha}","git_commits_url":"https://api.github.com/repos/ojarjur/datalab/git/commits{/sha}","comments_url":"https://api.github.com/repos/ojarjur/datalab/comments{/number}","issue_comment_url":"https://api.github.com/repos/ojarjur/datalab/issues/comments{/number}","contents_url":"https://api.github.com/repos/ojarjur/datalab/contents/{+path}","compare_url":"https://api.github.com/repos/ojarjur/datalab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ojarjur/datalab/merges","archive_url":"https://api.github.com/repos/ojarjur/datalab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ojarjur/datalab/downloads","issues_url":"https://api.github.com/repos/ojarjur/datalab/issues{/number}","pulls_url":"https://api.github.com/repos/ojarjur/datalab/pulls{/number}","milestones_url":"https://api.github.com/repos/ojarjur/datalab/milestones{/number}","notifications_url":"https://api.github.com/repos/ojarjur/datalab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ojarjur/datalab/labels{/name}","releases_url":"https://api.github.com/repos/ojarjur/datalab/releases{/id}","deployments_url":"https://api.github.com/repos/ojarjur/datalab/deployments","created_at":"2016-05-19T01:03:40Z","updated_at":"2016-05-19T01:03:41Z","pushed_at":"2016-05-27T18:49:18Z","git_url":"git://github.com/ojarjur/datalab.git","ssh_url":"git@github.com:ojarjur/datalab.git","clone_url":"https://github.com/ojarjur/datalab.git","svn_url":"https://github.com/ojarjur/datalab","homepage":"","size":183176,"stargazers_count":0,"watchers_count":0,"language":"Jupyter Notebook","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":"GoogleCloudPlatform:master","ref":"master","sha":"bfcc632569d46fa9e3915dae7e949afadaf8fe0e","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":22693761,"name":"datalab","full_name":"GoogleCloudPlatform/datalab","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/datalab","description":"Interactive tools and developer experiences for Big Data on Google Cloud Platform.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/datalab","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/datalab/deployments","created_at":"2014-08-06T18:37:34Z","updated_at":"2016-05-26T09:00:25Z","pushed_at":"2016-05-27T18:57:20Z","git_url":"git://github.com/GoogleCloudPlatform/datalab.git","ssh_url":"git@github.com:GoogleCloudPlatform/datalab.git","clone_url":"https://github.com/GoogleCloudPlatform/datalab.git","svn_url":"https://github.com/GoogleCloudPlatform/datalab","homepage":"","size":184929,"stargazers_count":257,"watchers_count":257,"language":"Jupyter Notebook","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":58,"mirror_url":null,"open_issues_count":106,"forks":58,"open_issues":106,"watchers":257,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864"},"html":{"href":"https://github.com/GoogleCloudPlatform/datalab/pull/864"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/864"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/issues/864/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/pulls/864/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/datalab/statuses/13798d588e0b4eb34053c6ac64c8a907ce054abe"}}}}
{"actor":{"display_login":"qimingj"}}