{"action":"created","comment":{"url":"https://api.github.com/repos/framgia/fbs_01/pulls/comments/91675796","pull_request_review_id":12185890,"id":91675796,"diff_hunk":"@@ -32,8 +38,46 @@ class LoginController extends Controller\n      *\n      * @return void\n      */\n-    public function __construct()\n+    \n+    private $userRepository;\n+\n+    public function __construct(UserRepository $userRepository)\n     {\n         $this->middleware('guest', ['except' => 'logout']);\n+        $this->userRepository = $userRepository;\n+    }\n+\n+    /**\n+     * Redirect the user to the Facebook authentication page.\n+     *\n+     * @return Response\n+     */\n+    public function redirectToProvider($provider)\n+    {\n+        return Socialite::driver($provider)->redirect();\n+    }\n+ \n+    /**\n+     * Obtain the user information from Facebook.\n+     *\n+     * @return Response\n+     */\n+    public function handleProviderCallback($provider)\n+    {\n+        try {\n+            $user = Socialite::driver($provider)->user();\n+            $authUser = $this->userRepository->findOrCreateUser($provider, $user);\n+            Auth::login($authUser, true);\n+        } catch (Exception $e) {\n+            return redirect('auth/' . $provider);\n+        }\n+ \n+        return redirect('/home');\n+    }\n+\n+    protected function login(Request $request)\n+    {\n+        $data = $request->only('email', 'password');\n+        return $this->userRepository->login($data);","path":"app/Http/Controllers/Auth/LoginController.php","position":58,"original_position":58,"commit_id":"8cb286d62c672145abdf3b7b96be936b38434f52","original_commit_id":"8cb286d62c672145abdf3b7b96be936b38434f52","user":{"login":"HoangThiTuanDung","id":5584520,"avatar_url":"https://avatars.githubusercontent.com/u/5584520?v=3","gravatar_id":"","url":"https://api.github.com/users/HoangThiTuanDung","html_url":"https://github.com/HoangThiTuanDung","followers_url":"https://api.github.com/users/HoangThiTuanDung/followers","following_url":"https://api.github.com/users/HoangThiTuanDung/following{/other_user}","gists_url":"https://api.github.com/users/HoangThiTuanDung/gists{/gist_id}","starred_url":"https://api.github.com/users/HoangThiTuanDung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HoangThiTuanDung/subscriptions","organizations_url":"https://api.github.com/users/HoangThiTuanDung/orgs","repos_url":"https://api.github.com/users/HoangThiTuanDung/repos","events_url":"https://api.github.com/users/HoangThiTuanDung/events{/privacy}","received_events_url":"https://api.github.com/users/HoangThiTuanDung/received_events","type":"User","site_admin":false},"body":"Quy ước cách viết này nhé, nếu bên trên return có tồn tại level cùng cấp với nó, ví dụ như:\r\n```\r\nif () {\r\n    ...\r\n    \r\n    return;\r\n}\r\n```\r\nthì trước return có 1 dòng trắng, ngược lại thì không cần\r\n```\r\nif () {\r\n    return;\r\n}\r\n```","created_at":"2016-12-09T08:34:26Z","updated_at":"2016-12-09T08:35:24Z","html_url":"https://github.com/framgia/fbs_01/pull/5#discussion_r91675796","pull_request_url":"https://api.github.com/repos/framgia/fbs_01/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/framgia/fbs_01/pulls/comments/91675796"},"html":{"href":"https://github.com/framgia/fbs_01/pull/5#discussion_r91675796"},"pull_request":{"href":"https://api.github.com/repos/framgia/fbs_01/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/framgia/fbs_01/pulls/5","id":97233450,"html_url":"https://github.com/framgia/fbs_01/pull/5","diff_url":"https://github.com/framgia/fbs_01/pull/5.diff","patch_url":"https://github.com/framgia/fbs_01/pull/5.patch","issue_url":"https://api.github.com/repos/framgia/fbs_01/issues/5","number":5,"state":"open","locked":false,"title":"login with openid","user":{"login":"tuanbaros","id":11793205,"avatar_url":"https://avatars.githubusercontent.com/u/11793205?v=3","gravatar_id":"","url":"https://api.github.com/users/tuanbaros","html_url":"https://github.com/tuanbaros","followers_url":"https://api.github.com/users/tuanbaros/followers","following_url":"https://api.github.com/users/tuanbaros/following{/other_user}","gists_url":"https://api.github.com/users/tuanbaros/gists{/gist_id}","starred_url":"https://api.github.com/users/tuanbaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuanbaros/subscriptions","organizations_url":"https://api.github.com/users/tuanbaros/orgs","repos_url":"https://api.github.com/users/tuanbaros/repos","events_url":"https://api.github.com/users/tuanbaros/events{/privacy}","received_events_url":"https://api.github.com/users/tuanbaros/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-09T01:08:33Z","updated_at":"2016-12-09T08:35:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f72674bed2b787f2ca26dddd3c7eb92584a572b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/framgia/fbs_01/pulls/5/commits","review_comments_url":"https://api.github.com/repos/framgia/fbs_01/pulls/5/comments","review_comment_url":"https://api.github.com/repos/framgia/fbs_01/pulls/comments{/number}","comments_url":"https://api.github.com/repos/framgia/fbs_01/issues/5/comments","statuses_url":"https://api.github.com/repos/framgia/fbs_01/statuses/8cb286d62c672145abdf3b7b96be936b38434f52","head":{"label":"tuanbaros:openid","ref":"openid","sha":"8cb286d62c672145abdf3b7b96be936b38434f52","user":{"login":"tuanbaros","id":11793205,"avatar_url":"https://avatars.githubusercontent.com/u/11793205?v=3","gravatar_id":"","url":"https://api.github.com/users/tuanbaros","html_url":"https://github.com/tuanbaros","followers_url":"https://api.github.com/users/tuanbaros/followers","following_url":"https://api.github.com/users/tuanbaros/following{/other_user}","gists_url":"https://api.github.com/users/tuanbaros/gists{/gist_id}","starred_url":"https://api.github.com/users/tuanbaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuanbaros/subscriptions","organizations_url":"https://api.github.com/users/tuanbaros/orgs","repos_url":"https://api.github.com/users/tuanbaros/repos","events_url":"https://api.github.com/users/tuanbaros/events{/privacy}","received_events_url":"https://api.github.com/users/tuanbaros/received_events","type":"User","site_admin":false},"repo":{"id":75815102,"name":"fbs_01","full_name":"tuanbaros/fbs_01","owner":{"login":"tuanbaros","id":11793205,"avatar_url":"https://avatars.githubusercontent.com/u/11793205?v=3","gravatar_id":"","url":"https://api.github.com/users/tuanbaros","html_url":"https://github.com/tuanbaros","followers_url":"https://api.github.com/users/tuanbaros/followers","following_url":"https://api.github.com/users/tuanbaros/following{/other_user}","gists_url":"https://api.github.com/users/tuanbaros/gists{/gist_id}","starred_url":"https://api.github.com/users/tuanbaros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuanbaros/subscriptions","organizations_url":"https://api.github.com/users/tuanbaros/orgs","repos_url":"https://api.github.com/users/tuanbaros/repos","events_url":"https://api.github.com/users/tuanbaros/events{/privacy}","received_events_url":"https://api.github.com/users/tuanbaros/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tuanbaros/fbs_01","description":"Framgia Buy & Sale (training)","fork":true,"url":"https://api.github.com/repos/tuanbaros/fbs_01","forks_url":"https://api.github.com/repos/tuanbaros/fbs_01/forks","keys_url":"https://api.github.com/repos/tuanbaros/fbs_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tuanbaros/fbs_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tuanbaros/fbs_01/teams","hooks_url":"https://api.github.com/repos/tuanbaros/fbs_01/hooks","issue_events_url":"https://api.github.com/repos/tuanbaros/fbs_01/issues/events{/number}","events_url":"https://api.github.com/repos/tuanbaros/fbs_01/events","assignees_url":"https://api.github.com/repos/tuanbaros/fbs_01/assignees{/user}","branches_url":"https://api.github.com/repos/tuanbaros/fbs_01/branches{/branch}","tags_url":"https://api.github.com/repos/tuanbaros/fbs_01/tags","blobs_url":"https://api.github.com/repos/tuanbaros/fbs_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tuanbaros/fbs_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tuanbaros/fbs_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/tuanbaros/fbs_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tuanbaros/fbs_01/statuses/{sha}","languages_url":"https://api.github.com/repos/tuanbaros/fbs_01/languages","stargazers_url":"https://api.github.com/repos/tuanbaros/fbs_01/stargazers","contributors_url":"https://api.github.com/repos/tuanbaros/fbs_01/contributors","subscribers_url":"https://api.github.com/repos/tuanbaros/fbs_01/subscribers","subscription_url":"https://api.github.com/repos/tuanbaros/fbs_01/subscription","commits_url":"https://api.github.com/repos/tuanbaros/fbs_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/tuanbaros/fbs_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/tuanbaros/fbs_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/tuanbaros/fbs_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/tuanbaros/fbs_01/contents/{+path}","compare_url":"https://api.github.com/repos/tuanbaros/fbs_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tuanbaros/fbs_01/merges","archive_url":"https://api.github.com/repos/tuanbaros/fbs_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tuanbaros/fbs_01/downloads","issues_url":"https://api.github.com/repos/tuanbaros/fbs_01/issues{/number}","pulls_url":"https://api.github.com/repos/tuanbaros/fbs_01/pulls{/number}","milestones_url":"https://api.github.com/repos/tuanbaros/fbs_01/milestones{/number}","notifications_url":"https://api.github.com/repos/tuanbaros/fbs_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tuanbaros/fbs_01/labels{/name}","releases_url":"https://api.github.com/repos/tuanbaros/fbs_01/releases{/id}","deployments_url":"https://api.github.com/repos/tuanbaros/fbs_01/deployments","created_at":"2016-12-07T08:23:57Z","updated_at":"2016-12-07T07:26:45Z","pushed_at":"2016-12-09T08:20:54Z","git_url":"git://github.com/tuanbaros/fbs_01.git","ssh_url":"git@github.com:tuanbaros/fbs_01.git","clone_url":"https://github.com/tuanbaros/fbs_01.git","svn_url":"https://github.com/tuanbaros/fbs_01","homepage":null,"size":258,"stargazers_count":0,"watchers_count":0,"language":null,"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":"framgia:develop","ref":"develop","sha":"596f864fe3182beb753a8a5a25d67e61352f1b37","user":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"repo":{"id":75810837,"name":"fbs_01","full_name":"framgia/fbs_01","owner":{"login":"framgia","id":2322183,"avatar_url":"https://avatars.githubusercontent.com/u/2322183?v=3","gravatar_id":"","url":"https://api.github.com/users/framgia","html_url":"https://github.com/framgia","followers_url":"https://api.github.com/users/framgia/followers","following_url":"https://api.github.com/users/framgia/following{/other_user}","gists_url":"https://api.github.com/users/framgia/gists{/gist_id}","starred_url":"https://api.github.com/users/framgia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/framgia/subscriptions","organizations_url":"https://api.github.com/users/framgia/orgs","repos_url":"https://api.github.com/users/framgia/repos","events_url":"https://api.github.com/users/framgia/events{/privacy}","received_events_url":"https://api.github.com/users/framgia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/framgia/fbs_01","description":"Framgia Buy & Sale (training)","fork":false,"url":"https://api.github.com/repos/framgia/fbs_01","forks_url":"https://api.github.com/repos/framgia/fbs_01/forks","keys_url":"https://api.github.com/repos/framgia/fbs_01/keys{/key_id}","collaborators_url":"https://api.github.com/repos/framgia/fbs_01/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/framgia/fbs_01/teams","hooks_url":"https://api.github.com/repos/framgia/fbs_01/hooks","issue_events_url":"https://api.github.com/repos/framgia/fbs_01/issues/events{/number}","events_url":"https://api.github.com/repos/framgia/fbs_01/events","assignees_url":"https://api.github.com/repos/framgia/fbs_01/assignees{/user}","branches_url":"https://api.github.com/repos/framgia/fbs_01/branches{/branch}","tags_url":"https://api.github.com/repos/framgia/fbs_01/tags","blobs_url":"https://api.github.com/repos/framgia/fbs_01/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/framgia/fbs_01/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/framgia/fbs_01/git/refs{/sha}","trees_url":"https://api.github.com/repos/framgia/fbs_01/git/trees{/sha}","statuses_url":"https://api.github.com/repos/framgia/fbs_01/statuses/{sha}","languages_url":"https://api.github.com/repos/framgia/fbs_01/languages","stargazers_url":"https://api.github.com/repos/framgia/fbs_01/stargazers","contributors_url":"https://api.github.com/repos/framgia/fbs_01/contributors","subscribers_url":"https://api.github.com/repos/framgia/fbs_01/subscribers","subscription_url":"https://api.github.com/repos/framgia/fbs_01/subscription","commits_url":"https://api.github.com/repos/framgia/fbs_01/commits{/sha}","git_commits_url":"https://api.github.com/repos/framgia/fbs_01/git/commits{/sha}","comments_url":"https://api.github.com/repos/framgia/fbs_01/comments{/number}","issue_comment_url":"https://api.github.com/repos/framgia/fbs_01/issues/comments{/number}","contents_url":"https://api.github.com/repos/framgia/fbs_01/contents/{+path}","compare_url":"https://api.github.com/repos/framgia/fbs_01/compare/{base}...{head}","merges_url":"https://api.github.com/repos/framgia/fbs_01/merges","archive_url":"https://api.github.com/repos/framgia/fbs_01/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/framgia/fbs_01/downloads","issues_url":"https://api.github.com/repos/framgia/fbs_01/issues{/number}","pulls_url":"https://api.github.com/repos/framgia/fbs_01/pulls{/number}","milestones_url":"https://api.github.com/repos/framgia/fbs_01/milestones{/number}","notifications_url":"https://api.github.com/repos/framgia/fbs_01/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/framgia/fbs_01/labels{/name}","releases_url":"https://api.github.com/repos/framgia/fbs_01/releases{/id}","deployments_url":"https://api.github.com/repos/framgia/fbs_01/deployments","created_at":"2016-12-07T07:26:45Z","updated_at":"2016-12-08T03:04:30Z","pushed_at":"2016-12-09T08:22:19Z","git_url":"git://github.com/framgia/fbs_01.git","ssh_url":"git@github.com:framgia/fbs_01.git","clone_url":"https://github.com/framgia/fbs_01.git","svn_url":"https://github.com/framgia/fbs_01","homepage":null,"size":228,"stargazers_count":1,"watchers_count":1,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/framgia/fbs_01/pulls/5"},"html":{"href":"https://github.com/framgia/fbs_01/pull/5"},"issue":{"href":"https://api.github.com/repos/framgia/fbs_01/issues/5"},"comments":{"href":"https://api.github.com/repos/framgia/fbs_01/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/framgia/fbs_01/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/framgia/fbs_01/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/framgia/fbs_01/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/framgia/fbs_01/statuses/8cb286d62c672145abdf3b7b96be936b38434f52"}}}}
{"actor":{"display_login":"HoangThiTuanDung"}}