{"action":"created","comment":{"url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/comments/170626054","pull_request_review_id":99335539,"id":170626054,"diff_hunk":"@@ -1,29 +1,105 @@\n import React from 'react';\n+import { compose, withState, withHandlers } from 'recompose';\n \n import logo from '../../../public/assets/images/sports-logo.png';\n \n-const Login = props => (\n-  <div className=\"login-outer-container\">\n-    <div className=\"login-inner-container\">\n-      <div className=\"login-header\">\n-        <a href=\"#\">\n-          <img src={logo} alt=\"Sports logo\" />\n-        </a>\n-      </div>\n-      <form className=\"login-form\">\n-        <div className=\"input-group\">\n-          <input type=\"email\" placeholder=\"EMAIL\" name=\"email\" required />\n-          <input\n-            type=\"password\"\n-            placeholder=\"PASSWORD\"\n-            name=\"password\"\n-            required\n-          />\n+import { LOCAL_AUTH_VARIABLE } from '../../constants/constants';\n+import { DEFAULT_LOGIN_ERROR_MESSAGE } from '../../constants/errorMessages';\n+\n+import { setTokenInHeader } from '../../utils/axios';\n+\n+import login from '../../services/authServices/login';\n+\n+import redirectIfAuthenticated from '../hocs/redirectIfAuthenticated';\n+\n+const Login = props => {\n+  const {\n+    handleLogin,\n+    errorMessage,\n+    handleEmailChange,\n+    shouldShowLoginError,\n+    handlePasswordChange\n+  } = props;\n+\n+  return (\n+    <div className=\"login-outer-container\">\n+      <div className=\"login-inner-container\">\n+        <div className=\"login-header\">\n+          <a href=\"/\">\n+            <img src={logo} alt=\"Sports logo\" />\n+          </a>\n         </div>\n-        <button type=\"submit\">SIGN IN</button>\n-      </form>\n+        <form className=\"login-form\" onSubmit={handleLogin}>\n+          <div className=\"input-group\">\n+            <input\n+              type=\"email\"\n+              placeholder=\"EMAIL\"\n+              name=\"email\"\n+              required\n+              onChange={handleEmailChange}\n+            />\n+            <input\n+              type=\"password\"\n+              placeholder=\"PASSWORD\"\n+              name=\"password\"\n+              required\n+              onChange={handlePasswordChange}\n+            />\n+          </div>\n+          <button type=\"submit\">SIGN IN</button>\n+        </form>\n+      </div>\n     </div>\n-  </div>\n-);\n+  );\n+};\n+\n+export default compose(\n+  withState('email', 'setEmail', ''),\n+  withState('password', 'setPassword', ''),\n+  withState('shouldShowLoginError', 'setShouldShowLoginError', false),","path":"frontend/src/components/auth/Login.js","position":80,"original_position":80,"commit_id":"832454dd13e5fd5ce31cb5e1d4ea5417a663ce78","original_commit_id":"832454dd13e5fd5ce31cb5e1d4ea5417a663ce78","user":{"login":"aviskarkc10","id":13309631,"avatar_url":"https://avatars2.githubusercontent.com/u/13309631?v=4","gravatar_id":"","url":"https://api.github.com/users/aviskarkc10","html_url":"https://github.com/aviskarkc10","followers_url":"https://api.github.com/users/aviskarkc10/followers","following_url":"https://api.github.com/users/aviskarkc10/following{/other_user}","gists_url":"https://api.github.com/users/aviskarkc10/gists{/gist_id}","starred_url":"https://api.github.com/users/aviskarkc10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aviskarkc10/subscriptions","organizations_url":"https://api.github.com/users/aviskarkc10/orgs","repos_url":"https://api.github.com/users/aviskarkc10/repos","events_url":"https://api.github.com/users/aviskarkc10/events{/privacy}","received_events_url":"https://api.github.com/users/aviskarkc10/received_events","type":"User","site_admin":false},"body":"showLoginError and toggleLoginError","created_at":"2018-02-26T15:22:07Z","updated_at":"2018-02-26T15:33:44Z","html_url":"https://github.com/leapfrogtechnology/LF-Sports/pull/34#discussion_r170626054","pull_request_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/comments/170626054"},"html":{"href":"https://github.com/leapfrogtechnology/LF-Sports/pull/34#discussion_r170626054"},"pull_request":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34"}}},"pull_request":{"url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34","id":171399965,"html_url":"https://github.com/leapfrogtechnology/LF-Sports/pull/34","diff_url":"https://github.com/leapfrogtechnology/LF-Sports/pull/34.diff","patch_url":"https://github.com/leapfrogtechnology/LF-Sports/pull/34.patch","issue_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/34","number":34,"state":"open","locked":false,"title":"SPORTS-53 Enable user to login and logout","user":{"login":"arun-tamang","id":27883939,"avatar_url":"https://avatars3.githubusercontent.com/u/27883939?v=4","gravatar_id":"","url":"https://api.github.com/users/arun-tamang","html_url":"https://github.com/arun-tamang","followers_url":"https://api.github.com/users/arun-tamang/followers","following_url":"https://api.github.com/users/arun-tamang/following{/other_user}","gists_url":"https://api.github.com/users/arun-tamang/gists{/gist_id}","starred_url":"https://api.github.com/users/arun-tamang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arun-tamang/subscriptions","organizations_url":"https://api.github.com/users/arun-tamang/orgs","repos_url":"https://api.github.com/users/arun-tamang/repos","events_url":"https://api.github.com/users/arun-tamang/events{/privacy}","received_events_url":"https://api.github.com/users/arun-tamang/received_events","type":"User","site_admin":false},"body":"- Enable user to login\r\n- Redirect to login page when protected pages are to be accessed\r\n- Enable user to logout\r\n- Add interceptor for automatic refreshing of access token\r\n- Display login error in in login page\r\n- Display general errors in Toaster.","created_at":"2018-02-26T15:05:15Z","updated_at":"2018-02-26T15:33:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afcde0b3902355d1b2607fc36b4fd16c573080e3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Ishanliv99","id":11689988,"avatar_url":"https://avatars0.githubusercontent.com/u/11689988?v=4","gravatar_id":"","url":"https://api.github.com/users/Ishanliv99","html_url":"https://github.com/Ishanliv99","followers_url":"https://api.github.com/users/Ishanliv99/followers","following_url":"https://api.github.com/users/Ishanliv99/following{/other_user}","gists_url":"https://api.github.com/users/Ishanliv99/gists{/gist_id}","starred_url":"https://api.github.com/users/Ishanliv99/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ishanliv99/subscriptions","organizations_url":"https://api.github.com/users/Ishanliv99/orgs","repos_url":"https://api.github.com/users/Ishanliv99/repos","events_url":"https://api.github.com/users/Ishanliv99/events{/privacy}","received_events_url":"https://api.github.com/users/Ishanliv99/received_events","type":"User","site_admin":false},{"login":"sanjeevkpandit","id":13619272,"avatar_url":"https://avatars0.githubusercontent.com/u/13619272?v=4","gravatar_id":"","url":"https://api.github.com/users/sanjeevkpandit","html_url":"https://github.com/sanjeevkpandit","followers_url":"https://api.github.com/users/sanjeevkpandit/followers","following_url":"https://api.github.com/users/sanjeevkpandit/following{/other_user}","gists_url":"https://api.github.com/users/sanjeevkpandit/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjeevkpandit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjeevkpandit/subscriptions","organizations_url":"https://api.github.com/users/sanjeevkpandit/orgs","repos_url":"https://api.github.com/users/sanjeevkpandit/repos","events_url":"https://api.github.com/users/sanjeevkpandit/events{/privacy}","received_events_url":"https://api.github.com/users/sanjeevkpandit/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":810090870,"url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/labels/new%20feature%20:new:","name":"new feature :new:","color":"1d76db","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34/commits","review_comments_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34/comments","review_comment_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/comments{/number}","comments_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/34/comments","statuses_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/statuses/832454dd13e5fd5ce31cb5e1d4ea5417a663ce78","head":{"label":"leapfrogtechnology:SPORTS-53","ref":"SPORTS-53","sha":"832454dd13e5fd5ce31cb5e1d4ea5417a663ce78","user":{"login":"leapfrogtechnology","id":3176020,"avatar_url":"https://avatars1.githubusercontent.com/u/3176020?v=4","gravatar_id":"","url":"https://api.github.com/users/leapfrogtechnology","html_url":"https://github.com/leapfrogtechnology","followers_url":"https://api.github.com/users/leapfrogtechnology/followers","following_url":"https://api.github.com/users/leapfrogtechnology/following{/other_user}","gists_url":"https://api.github.com/users/leapfrogtechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/leapfrogtechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leapfrogtechnology/subscriptions","organizations_url":"https://api.github.com/users/leapfrogtechnology/orgs","repos_url":"https://api.github.com/users/leapfrogtechnology/repos","events_url":"https://api.github.com/users/leapfrogtechnology/events{/privacy}","received_events_url":"https://api.github.com/users/leapfrogtechnology/received_events","type":"Organization","site_admin":false},"repo":{"id":115388139,"name":"LF-Sports","full_name":"leapfrogtechnology/LF-Sports","owner":{"login":"leapfrogtechnology","id":3176020,"avatar_url":"https://avatars1.githubusercontent.com/u/3176020?v=4","gravatar_id":"","url":"https://api.github.com/users/leapfrogtechnology","html_url":"https://github.com/leapfrogtechnology","followers_url":"https://api.github.com/users/leapfrogtechnology/followers","following_url":"https://api.github.com/users/leapfrogtechnology/following{/other_user}","gists_url":"https://api.github.com/users/leapfrogtechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/leapfrogtechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leapfrogtechnology/subscriptions","organizations_url":"https://api.github.com/users/leapfrogtechnology/orgs","repos_url":"https://api.github.com/users/leapfrogtechnology/repos","events_url":"https://api.github.com/users/leapfrogtechnology/events{/privacy}","received_events_url":"https://api.github.com/users/leapfrogtechnology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leapfrogtechnology/LF-Sports","description":"LF Sports Management Website Development","fork":false,"url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports","forks_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/forks","keys_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/teams","hooks_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/hooks","issue_events_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/events{/number}","events_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/events","assignees_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/assignees{/user}","branches_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/branches{/branch}","tags_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/tags","blobs_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/refs{/sha}","trees_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/statuses/{sha}","languages_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/languages","stargazers_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/stargazers","contributors_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/contributors","subscribers_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/subscribers","subscription_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/subscription","commits_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/commits{/sha}","git_commits_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/commits{/sha}","comments_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/comments{/number}","issue_comment_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/comments{/number}","contents_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/contents/{+path}","compare_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/merges","archive_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/downloads","issues_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues{/number}","pulls_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls{/number}","milestones_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/milestones{/number}","notifications_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/labels{/name}","releases_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/releases{/id}","deployments_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/deployments","created_at":"2017-12-26T05:22:13Z","updated_at":"2018-02-16T11:15:48Z","pushed_at":"2018-02-26T15:05:16Z","git_url":"git://github.com/leapfrogtechnology/LF-Sports.git","ssh_url":"git@github.com:leapfrogtechnology/LF-Sports.git","clone_url":"https://github.com/leapfrogtechnology/LF-Sports.git","svn_url":"https://github.com/leapfrogtechnology/LF-Sports","homepage":"","size":1645,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev"}},"base":{"label":"leapfrogtechnology:dev","ref":"dev","sha":"c00cb72b4b374ecfca67ffef4eae4d912530a347","user":{"login":"leapfrogtechnology","id":3176020,"avatar_url":"https://avatars1.githubusercontent.com/u/3176020?v=4","gravatar_id":"","url":"https://api.github.com/users/leapfrogtechnology","html_url":"https://github.com/leapfrogtechnology","followers_url":"https://api.github.com/users/leapfrogtechnology/followers","following_url":"https://api.github.com/users/leapfrogtechnology/following{/other_user}","gists_url":"https://api.github.com/users/leapfrogtechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/leapfrogtechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leapfrogtechnology/subscriptions","organizations_url":"https://api.github.com/users/leapfrogtechnology/orgs","repos_url":"https://api.github.com/users/leapfrogtechnology/repos","events_url":"https://api.github.com/users/leapfrogtechnology/events{/privacy}","received_events_url":"https://api.github.com/users/leapfrogtechnology/received_events","type":"Organization","site_admin":false},"repo":{"id":115388139,"name":"LF-Sports","full_name":"leapfrogtechnology/LF-Sports","owner":{"login":"leapfrogtechnology","id":3176020,"avatar_url":"https://avatars1.githubusercontent.com/u/3176020?v=4","gravatar_id":"","url":"https://api.github.com/users/leapfrogtechnology","html_url":"https://github.com/leapfrogtechnology","followers_url":"https://api.github.com/users/leapfrogtechnology/followers","following_url":"https://api.github.com/users/leapfrogtechnology/following{/other_user}","gists_url":"https://api.github.com/users/leapfrogtechnology/gists{/gist_id}","starred_url":"https://api.github.com/users/leapfrogtechnology/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leapfrogtechnology/subscriptions","organizations_url":"https://api.github.com/users/leapfrogtechnology/orgs","repos_url":"https://api.github.com/users/leapfrogtechnology/repos","events_url":"https://api.github.com/users/leapfrogtechnology/events{/privacy}","received_events_url":"https://api.github.com/users/leapfrogtechnology/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/leapfrogtechnology/LF-Sports","description":"LF Sports Management Website Development","fork":false,"url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports","forks_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/forks","keys_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/teams","hooks_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/hooks","issue_events_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/events{/number}","events_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/events","assignees_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/assignees{/user}","branches_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/branches{/branch}","tags_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/tags","blobs_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/refs{/sha}","trees_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/statuses/{sha}","languages_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/languages","stargazers_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/stargazers","contributors_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/contributors","subscribers_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/subscribers","subscription_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/subscription","commits_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/commits{/sha}","git_commits_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/git/commits{/sha}","comments_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/comments{/number}","issue_comment_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/comments{/number}","contents_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/contents/{+path}","compare_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/merges","archive_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/downloads","issues_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues{/number}","pulls_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls{/number}","milestones_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/milestones{/number}","notifications_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/labels{/name}","releases_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/releases{/id}","deployments_url":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/deployments","created_at":"2017-12-26T05:22:13Z","updated_at":"2018-02-16T11:15:48Z","pushed_at":"2018-02-26T15:05:16Z","git_url":"git://github.com/leapfrogtechnology/LF-Sports.git","ssh_url":"git@github.com:leapfrogtechnology/LF-Sports.git","clone_url":"https://github.com/leapfrogtechnology/LF-Sports.git","svn_url":"https://github.com/leapfrogtechnology/LF-Sports","homepage":"","size":1645,"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":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34"},"html":{"href":"https://github.com/leapfrogtechnology/LF-Sports/pull/34"},"issue":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/34"},"comments":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/issues/34/comments"},"review_comments":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34/comments"},"review_comment":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/pulls/34/commits"},"statuses":{"href":"https://api.github.com/repos/leapfrogtechnology/LF-Sports/statuses/832454dd13e5fd5ce31cb5e1d4ea5417a663ce78"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"aviskarkc10"}}