{"action":"created","comment":{"url":"https://api.github.com/repos/JonasMS/Athena/pulls/comments/185357359","pull_request_review_id":116729319,"id":185357359,"diff_hunk":"@@ -67,74 +49,63 @@ class App extends Component {\n         }\n     }\n \n-    getOAuthStatus() {\n-        getLoginStatus().then(user => {\n-            if (this.state.user) {\n-                return;\n-            }\n-\n-            this.initializeUser(user);\n-        });\n-    }\n-\n-    initOAuth() {\n+    authInit = () => {\n         if (process.env.OFFLINE_DEV === 'true') {\n             this.fetchUser(process.env.USER_OAUTH_ID, process.env.USER_OAUTH_HOST);\n             return;\n         }\n \n-        initOAuth().then(this.getOAuthStatus);\n-    }\n-\n-    handleSignUpGoogle() {\n-        signupUserGoogle().then(user => {\n-            if (!user || !user.id) {\n-                // TODO handle error\n-                this.setState({isLoading: false});\n-                return;\n-            }\n-\n-            if (mixpanel && mixpanel.track) {\n-                mixpanel.track('SIGN_UP_USER:GOOGLE');\n-            }\n-\n-            this.setState({\n-                user,\n-                isLoading: false,\n-            });\n-            localStorage.setItem('athena-oauth-host', OAUTH_HOST_GOOGLE);\n-            /* fb pixel event tracking */\n-            if (process.env.NODE_ENV === 'production' && fbq) {\n-                fbq('track', 'CompleteRegistration');\n+        firebase.auth().onAuthStateChanged((firebaseUser) => {\n+            if (firebaseUser) {\n+                firebaseUser.getIdToken().then(token => {\n+                    fetchSignupUser(token).then((user) => {\n+                    // fetchLogin(token).then((user) => {\n+                        if (user && user.id) {\n+                            this.initializeUser(user);\n+                        } else {\n+                            this.props.onSetLoadingStatus(false);\n+                        }\n+                    });\n+                });\n+            } else {\n+                this.props.onSetLoadingStatus(false);\n             }\n         });\n     }\n \n-    handleSignUpFB() {\n-        signupUserFB().then(user => {\n-            if (!user || !user.id) {\n-                // TODO handle error\n-                this.setState({isLoading: false});\n-                return;\n-            }\n-\n-            if (mixpanel && mixpanel.track) {\n-                mixpanel.track('SIGN_UP_USER:FB');\n-            }\n-\n-            this.setState({\n-                user,\n-                isLoading: false,\n-            });\n-            localStorage.setItem('athena-oauth-host', OAUTH_HOST_FB);\n-            /* fb pixel event tracking */\n-            if (process.env.NODE_ENV === 'production' && fbq) {\n-                fbq('track', 'CompleteRegistration');\n-            }\n-        });\n+    handleSignUp = (provider) => {\n+        firebase.auth().signInWithPopup(provider);\n+        // .then(() => {\n+        //     firebase.auth().currentUser.getToken().then((idToken) => {\n+        //         fetchSignupUser(idToken).then((user) => {\n+        //             if (user && user.id) {\n+        //                 this.initializeUser(user);\n+        //             }\n+        //         }).catch(err => console.log(err.message));\n+        //     });\n+        // }).catch((err) => {\n+        //     console.log(err.message);\n+        // });\n     }\n \n-    fetchUser(oAuthID, oAuthHost = OAUTH_HOST_FB) {\n+    // handleSignUpGoogle = () => {","path":"src/client/src/index.js","position":151,"original_position":151,"commit_id":"c3609875c68e4ad319021fc871f36f15df7ad190","original_commit_id":"c3609875c68e4ad319021fc871f36f15df7ad190","user":{"login":"JonasMS","id":8249197,"avatar_url":"https://avatars0.githubusercontent.com/u/8249197?v=4","gravatar_id":"","url":"https://api.github.com/users/JonasMS","html_url":"https://github.com/JonasMS","followers_url":"https://api.github.com/users/JonasMS/followers","following_url":"https://api.github.com/users/JonasMS/following{/other_user}","gists_url":"https://api.github.com/users/JonasMS/gists{/gist_id}","starred_url":"https://api.github.com/users/JonasMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonasMS/subscriptions","organizations_url":"https://api.github.com/users/JonasMS/orgs","repos_url":"https://api.github.com/users/JonasMS/repos","events_url":"https://api.github.com/users/JonasMS/events{/privacy}","received_events_url":"https://api.github.com/users/JonasMS/received_events","type":"User","site_admin":false},"body":"remove commented-out code","created_at":"2018-05-01T23:06:06Z","updated_at":"2018-05-01T23:12:04Z","html_url":"https://github.com/JonasMS/Athena/pull/353#discussion_r185357359","pull_request_url":"https://api.github.com/repos/JonasMS/Athena/pulls/353","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/JonasMS/Athena/pulls/comments/185357359"},"html":{"href":"https://github.com/JonasMS/Athena/pull/353#discussion_r185357359"},"pull_request":{"href":"https://api.github.com/repos/JonasMS/Athena/pulls/353"}}},"pull_request":{"url":"https://api.github.com/repos/JonasMS/Athena/pulls/353","id":185297525,"html_url":"https://github.com/JonasMS/Athena/pull/353","diff_url":"https://github.com/JonasMS/Athena/pull/353.diff","patch_url":"https://github.com/JonasMS/Athena/pull/353.patch","issue_url":"https://api.github.com/repos/JonasMS/Athena/issues/353","number":353,"state":"open","locked":false,"title":"W350: Feat Init Firebase","user":{"login":"JonasMS","id":8249197,"avatar_url":"https://avatars0.githubusercontent.com/u/8249197?v=4","gravatar_id":"","url":"https://api.github.com/users/JonasMS","html_url":"https://github.com/JonasMS","followers_url":"https://api.github.com/users/JonasMS/followers","following_url":"https://api.github.com/users/JonasMS/following{/other_user}","gists_url":"https://api.github.com/users/JonasMS/gists{/gist_id}","starred_url":"https://api.github.com/users/JonasMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonasMS/subscriptions","organizations_url":"https://api.github.com/users/JonasMS/orgs","repos_url":"https://api.github.com/users/JonasMS/repos","events_url":"https://api.github.com/users/JonasMS/events{/privacy}","received_events_url":"https://api.github.com/users/JonasMS/received_events","type":"User","site_admin":false},"body":"close #350 ","created_at":"2018-05-01T23:02:24Z","updated_at":"2018-05-01T23:12:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"102dc66b5ebf9ae9c721192f71a82acb968d47f3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":509387598,"url":"https://api.github.com/repos/JonasMS/Athena/labels/in%20progress","name":"in progress","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/JonasMS/Athena/pulls/353/commits","review_comments_url":"https://api.github.com/repos/JonasMS/Athena/pulls/353/comments","review_comment_url":"https://api.github.com/repos/JonasMS/Athena/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JonasMS/Athena/issues/353/comments","statuses_url":"https://api.github.com/repos/JonasMS/Athena/statuses/c3609875c68e4ad319021fc871f36f15df7ad190","head":{"label":"JonasMS:feat-init-firebase","ref":"feat-init-firebase","sha":"c3609875c68e4ad319021fc871f36f15df7ad190","user":{"login":"JonasMS","id":8249197,"avatar_url":"https://avatars0.githubusercontent.com/u/8249197?v=4","gravatar_id":"","url":"https://api.github.com/users/JonasMS","html_url":"https://github.com/JonasMS","followers_url":"https://api.github.com/users/JonasMS/followers","following_url":"https://api.github.com/users/JonasMS/following{/other_user}","gists_url":"https://api.github.com/users/JonasMS/gists{/gist_id}","starred_url":"https://api.github.com/users/JonasMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonasMS/subscriptions","organizations_url":"https://api.github.com/users/JonasMS/orgs","repos_url":"https://api.github.com/users/JonasMS/repos","events_url":"https://api.github.com/users/JonasMS/events{/privacy}","received_events_url":"https://api.github.com/users/JonasMS/received_events","type":"User","site_admin":false},"repo":{"id":68953969,"name":"Athena","full_name":"JonasMS/Athena","owner":{"login":"JonasMS","id":8249197,"avatar_url":"https://avatars0.githubusercontent.com/u/8249197?v=4","gravatar_id":"","url":"https://api.github.com/users/JonasMS","html_url":"https://github.com/JonasMS","followers_url":"https://api.github.com/users/JonasMS/followers","following_url":"https://api.github.com/users/JonasMS/following{/other_user}","gists_url":"https://api.github.com/users/JonasMS/gists{/gist_id}","starred_url":"https://api.github.com/users/JonasMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonasMS/subscriptions","organizations_url":"https://api.github.com/users/JonasMS/orgs","repos_url":"https://api.github.com/users/JonasMS/repos","events_url":"https://api.github.com/users/JonasMS/events{/privacy}","received_events_url":"https://api.github.com/users/JonasMS/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JonasMS/Athena","description":null,"fork":false,"url":"https://api.github.com/repos/JonasMS/Athena","forks_url":"https://api.github.com/repos/JonasMS/Athena/forks","keys_url":"https://api.github.com/repos/JonasMS/Athena/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JonasMS/Athena/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JonasMS/Athena/teams","hooks_url":"https://api.github.com/repos/JonasMS/Athena/hooks","issue_events_url":"https://api.github.com/repos/JonasMS/Athena/issues/events{/number}","events_url":"https://api.github.com/repos/JonasMS/Athena/events","assignees_url":"https://api.github.com/repos/JonasMS/Athena/assignees{/user}","branches_url":"https://api.github.com/repos/JonasMS/Athena/branches{/branch}","tags_url":"https://api.github.com/repos/JonasMS/Athena/tags","blobs_url":"https://api.github.com/repos/JonasMS/Athena/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JonasMS/Athena/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JonasMS/Athena/git/refs{/sha}","trees_url":"https://api.github.com/repos/JonasMS/Athena/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JonasMS/Athena/statuses/{sha}","languages_url":"https://api.github.com/repos/JonasMS/Athena/languages","stargazers_url":"https://api.github.com/repos/JonasMS/Athena/stargazers","contributors_url":"https://api.github.com/repos/JonasMS/Athena/contributors","subscribers_url":"https://api.github.com/repos/JonasMS/Athena/subscribers","subscription_url":"https://api.github.com/repos/JonasMS/Athena/subscription","commits_url":"https://api.github.com/repos/JonasMS/Athena/commits{/sha}","git_commits_url":"https://api.github.com/repos/JonasMS/Athena/git/commits{/sha}","comments_url":"https://api.github.com/repos/JonasMS/Athena/comments{/number}","issue_comment_url":"https://api.github.com/repos/JonasMS/Athena/issues/comments{/number}","contents_url":"https://api.github.com/repos/JonasMS/Athena/contents/{+path}","compare_url":"https://api.github.com/repos/JonasMS/Athena/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JonasMS/Athena/merges","archive_url":"https://api.github.com/repos/JonasMS/Athena/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JonasMS/Athena/downloads","issues_url":"https://api.github.com/repos/JonasMS/Athena/issues{/number}","pulls_url":"https://api.github.com/repos/JonasMS/Athena/pulls{/number}","milestones_url":"https://api.github.com/repos/JonasMS/Athena/milestones{/number}","notifications_url":"https://api.github.com/repos/JonasMS/Athena/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JonasMS/Athena/labels{/name}","releases_url":"https://api.github.com/repos/JonasMS/Athena/releases{/id}","deployments_url":"https://api.github.com/repos/JonasMS/Athena/deployments","created_at":"2016-09-22T19:14:07Z","updated_at":"2018-04-30T21:15:31Z","pushed_at":"2018-05-01T23:02:24Z","git_url":"git://github.com/JonasMS/Athena.git","ssh_url":"git@github.com:JonasMS/Athena.git","clone_url":"https://github.com/JonasMS/Athena.git","svn_url":"https://github.com/JonasMS/Athena","homepage":null,"size":3572,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":65,"license":null,"forks":0,"open_issues":65,"watchers":0,"default_branch":"master"}},"base":{"label":"JonasMS:master","ref":"master","sha":"2bbaab221da81f5b45790435fa772b10b16a4f2a","user":{"login":"JonasMS","id":8249197,"avatar_url":"https://avatars0.githubusercontent.com/u/8249197?v=4","gravatar_id":"","url":"https://api.github.com/users/JonasMS","html_url":"https://github.com/JonasMS","followers_url":"https://api.github.com/users/JonasMS/followers","following_url":"https://api.github.com/users/JonasMS/following{/other_user}","gists_url":"https://api.github.com/users/JonasMS/gists{/gist_id}","starred_url":"https://api.github.com/users/JonasMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonasMS/subscriptions","organizations_url":"https://api.github.com/users/JonasMS/orgs","repos_url":"https://api.github.com/users/JonasMS/repos","events_url":"https://api.github.com/users/JonasMS/events{/privacy}","received_events_url":"https://api.github.com/users/JonasMS/received_events","type":"User","site_admin":false},"repo":{"id":68953969,"name":"Athena","full_name":"JonasMS/Athena","owner":{"login":"JonasMS","id":8249197,"avatar_url":"https://avatars0.githubusercontent.com/u/8249197?v=4","gravatar_id":"","url":"https://api.github.com/users/JonasMS","html_url":"https://github.com/JonasMS","followers_url":"https://api.github.com/users/JonasMS/followers","following_url":"https://api.github.com/users/JonasMS/following{/other_user}","gists_url":"https://api.github.com/users/JonasMS/gists{/gist_id}","starred_url":"https://api.github.com/users/JonasMS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonasMS/subscriptions","organizations_url":"https://api.github.com/users/JonasMS/orgs","repos_url":"https://api.github.com/users/JonasMS/repos","events_url":"https://api.github.com/users/JonasMS/events{/privacy}","received_events_url":"https://api.github.com/users/JonasMS/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JonasMS/Athena","description":null,"fork":false,"url":"https://api.github.com/repos/JonasMS/Athena","forks_url":"https://api.github.com/repos/JonasMS/Athena/forks","keys_url":"https://api.github.com/repos/JonasMS/Athena/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JonasMS/Athena/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JonasMS/Athena/teams","hooks_url":"https://api.github.com/repos/JonasMS/Athena/hooks","issue_events_url":"https://api.github.com/repos/JonasMS/Athena/issues/events{/number}","events_url":"https://api.github.com/repos/JonasMS/Athena/events","assignees_url":"https://api.github.com/repos/JonasMS/Athena/assignees{/user}","branches_url":"https://api.github.com/repos/JonasMS/Athena/branches{/branch}","tags_url":"https://api.github.com/repos/JonasMS/Athena/tags","blobs_url":"https://api.github.com/repos/JonasMS/Athena/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JonasMS/Athena/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JonasMS/Athena/git/refs{/sha}","trees_url":"https://api.github.com/repos/JonasMS/Athena/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JonasMS/Athena/statuses/{sha}","languages_url":"https://api.github.com/repos/JonasMS/Athena/languages","stargazers_url":"https://api.github.com/repos/JonasMS/Athena/stargazers","contributors_url":"https://api.github.com/repos/JonasMS/Athena/contributors","subscribers_url":"https://api.github.com/repos/JonasMS/Athena/subscribers","subscription_url":"https://api.github.com/repos/JonasMS/Athena/subscription","commits_url":"https://api.github.com/repos/JonasMS/Athena/commits{/sha}","git_commits_url":"https://api.github.com/repos/JonasMS/Athena/git/commits{/sha}","comments_url":"https://api.github.com/repos/JonasMS/Athena/comments{/number}","issue_comment_url":"https://api.github.com/repos/JonasMS/Athena/issues/comments{/number}","contents_url":"https://api.github.com/repos/JonasMS/Athena/contents/{+path}","compare_url":"https://api.github.com/repos/JonasMS/Athena/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JonasMS/Athena/merges","archive_url":"https://api.github.com/repos/JonasMS/Athena/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JonasMS/Athena/downloads","issues_url":"https://api.github.com/repos/JonasMS/Athena/issues{/number}","pulls_url":"https://api.github.com/repos/JonasMS/Athena/pulls{/number}","milestones_url":"https://api.github.com/repos/JonasMS/Athena/milestones{/number}","notifications_url":"https://api.github.com/repos/JonasMS/Athena/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JonasMS/Athena/labels{/name}","releases_url":"https://api.github.com/repos/JonasMS/Athena/releases{/id}","deployments_url":"https://api.github.com/repos/JonasMS/Athena/deployments","created_at":"2016-09-22T19:14:07Z","updated_at":"2018-04-30T21:15:31Z","pushed_at":"2018-05-01T23:02:24Z","git_url":"git://github.com/JonasMS/Athena.git","ssh_url":"git@github.com:JonasMS/Athena.git","clone_url":"https://github.com/JonasMS/Athena.git","svn_url":"https://github.com/JonasMS/Athena","homepage":null,"size":3572,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":65,"license":null,"forks":0,"open_issues":65,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JonasMS/Athena/pulls/353"},"html":{"href":"https://github.com/JonasMS/Athena/pull/353"},"issue":{"href":"https://api.github.com/repos/JonasMS/Athena/issues/353"},"comments":{"href":"https://api.github.com/repos/JonasMS/Athena/issues/353/comments"},"review_comments":{"href":"https://api.github.com/repos/JonasMS/Athena/pulls/353/comments"},"review_comment":{"href":"https://api.github.com/repos/JonasMS/Athena/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JonasMS/Athena/pulls/353/commits"},"statuses":{"href":"https://api.github.com/repos/JonasMS/Athena/statuses/c3609875c68e4ad319021fc871f36f15df7ad190"}},"author_association":"OWNER"}}
{"actor":{"display_login":"JonasMS"}}