{"action":"created","comment":{"url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/comments/54147478","id":54147478,"diff_hunk":"@@ -0,0 +1,12 @@\n+class SessionsController < ApplicationController\n+  def create\n+    user = User.find_or_create_from_auth_hash(request.env['omniauth.auth'])","path":"app/controllers/sessions_controller.rb","position":3,"original_position":3,"commit_id":"a1d106580c145a52c11b3b01af8314dc95a568aa","original_commit_id":"3c2c094b37253cfe18c52973b133967646d36a9f","user":{"login":"TasukuNakano","id":1913131,"avatar_url":"https://avatars.githubusercontent.com/u/1913131?v=3","gravatar_id":"","url":"https://api.github.com/users/TasukuNakano","html_url":"https://github.com/TasukuNakano","followers_url":"https://api.github.com/users/TasukuNakano/followers","following_url":"https://api.github.com/users/TasukuNakano/following{/other_user}","gists_url":"https://api.github.com/users/TasukuNakano/gists{/gist_id}","starred_url":"https://api.github.com/users/TasukuNakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TasukuNakano/subscriptions","organizations_url":"https://api.github.com/users/TasukuNakano/orgs","repos_url":"https://api.github.com/users/TasukuNakano/repos","events_url":"https://api.github.com/users/TasukuNakano/events{/privacy}","received_events_url":"https://api.github.com/users/TasukuNakano/received_events","type":"User","site_admin":false},"body":"正直、わかってなかったです。\r\n\r\n`request.env` にはそもそもHTTPサーバから、リクエストのヘッダ情報などが入ったりするものなのですが、Hash形式で値を持っています。\r\nHTTPサーバ → unicorn → rails の controller という流れで、最後の controller で`request` オブジェクトに値が入るんですが、 `omniauth` はその controller の前処理に割り込んで、 認証情報などを `omniauth.auth` というキーとして保存している。\r\nというものみたいです","created_at":"2016-02-25T19:15:42Z","updated_at":"2016-02-25T19:15:42Z","html_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails/pull/7#discussion_r54147478","pull_request_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/comments/54147478"},"html":{"href":"https://github.com/TasukuNakano/perfect-ruby-on-rails/pull/7#discussion_r54147478"},"pull_request":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7","id":60164885,"html_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails/pull/7","diff_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails/pull/7.diff","patch_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails/pull/7.patch","issue_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/7","number":7,"state":"open","locked":false,"title":"Add login feature","user":{"login":"TasukuNakano","id":1913131,"avatar_url":"https://avatars.githubusercontent.com/u/1913131?v=3","gravatar_id":"","url":"https://api.github.com/users/TasukuNakano","html_url":"https://github.com/TasukuNakano","followers_url":"https://api.github.com/users/TasukuNakano/followers","following_url":"https://api.github.com/users/TasukuNakano/following{/other_user}","gists_url":"https://api.github.com/users/TasukuNakano/gists{/gist_id}","starred_url":"https://api.github.com/users/TasukuNakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TasukuNakano/subscriptions","organizations_url":"https://api.github.com/users/TasukuNakano/orgs","repos_url":"https://api.github.com/users/TasukuNakano/repos","events_url":"https://api.github.com/users/TasukuNakano/events{/privacy}","received_events_url":"https://api.github.com/users/TasukuNakano/received_events","type":"User","site_admin":false},"body":"ログイン機能の実装です。\r\n\r\nP174 ~ P181の途中まで\r\n\r\n# やったこと\r\n- User モデルの追加 00700d0\r\n- ログインの callback 用のルーティングを追加\r\n- 画面上にログイン、ログアウト用のリンクを配置\r\n- ログイン、ログアウトの処理を追加\r\n\r\n# WIP を外す条件\r\n- [x] #5 がマージされて、rebase済\r\n\r\n# マージ条件\r\n- [x] #1 がマージされること\r\n- [x] #6 がマージされること\r\n- [x] #5 がマージされること","created_at":"2016-02-22T12:19:14Z","updated_at":"2016-02-25T19:15:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"567a45484f9fbbc0bb7301291e44d516d71ff25d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7/commits","review_comments_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7/comments","review_comment_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/7/comments","statuses_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/statuses/a1d106580c145a52c11b3b01af8314dc95a568aa","head":{"label":"TasukuNakano:add-login-feature","ref":"add-login-feature","sha":"a1d106580c145a52c11b3b01af8314dc95a568aa","user":{"login":"TasukuNakano","id":1913131,"avatar_url":"https://avatars.githubusercontent.com/u/1913131?v=3","gravatar_id":"","url":"https://api.github.com/users/TasukuNakano","html_url":"https://github.com/TasukuNakano","followers_url":"https://api.github.com/users/TasukuNakano/followers","following_url":"https://api.github.com/users/TasukuNakano/following{/other_user}","gists_url":"https://api.github.com/users/TasukuNakano/gists{/gist_id}","starred_url":"https://api.github.com/users/TasukuNakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TasukuNakano/subscriptions","organizations_url":"https://api.github.com/users/TasukuNakano/orgs","repos_url":"https://api.github.com/users/TasukuNakano/repos","events_url":"https://api.github.com/users/TasukuNakano/events{/privacy}","received_events_url":"https://api.github.com/users/TasukuNakano/received_events","type":"User","site_admin":false},"repo":{"id":51999965,"name":"perfect-ruby-on-rails","full_name":"TasukuNakano/perfect-ruby-on-rails","owner":{"login":"TasukuNakano","id":1913131,"avatar_url":"https://avatars.githubusercontent.com/u/1913131?v=3","gravatar_id":"","url":"https://api.github.com/users/TasukuNakano","html_url":"https://github.com/TasukuNakano","followers_url":"https://api.github.com/users/TasukuNakano/followers","following_url":"https://api.github.com/users/TasukuNakano/following{/other_user}","gists_url":"https://api.github.com/users/TasukuNakano/gists{/gist_id}","starred_url":"https://api.github.com/users/TasukuNakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TasukuNakano/subscriptions","organizations_url":"https://api.github.com/users/TasukuNakano/orgs","repos_url":"https://api.github.com/users/TasukuNakano/repos","events_url":"https://api.github.com/users/TasukuNakano/events{/privacy}","received_events_url":"https://api.github.com/users/TasukuNakano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails","description":"パーフェクトRuby on Rails の写経用リポジトリ","fork":false,"url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails","forks_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/forks","keys_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/teams","hooks_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/hooks","issue_events_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/events{/number}","events_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/events","assignees_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/assignees{/user}","branches_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/branches{/branch}","tags_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/tags","blobs_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/languages","stargazers_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/stargazers","contributors_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/contributors","subscribers_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/subscribers","subscription_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/subscription","commits_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/contents/{+path}","compare_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/merges","archive_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/downloads","issues_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues{/number}","pulls_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/labels{/name}","releases_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/releases{/id}","deployments_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/deployments","created_at":"2016-02-18T10:34:27Z","updated_at":"2016-02-23T08:55:13Z","pushed_at":"2016-02-24T18:47:35Z","git_url":"git://github.com/TasukuNakano/perfect-ruby-on-rails.git","ssh_url":"git@github.com:TasukuNakano/perfect-ruby-on-rails.git","clone_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails.git","svn_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails","homepage":null,"size":94,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"TasukuNakano:master","ref":"master","sha":"4d9b6636c2f44d1213fa2ae539183f0395a84f36","user":{"login":"TasukuNakano","id":1913131,"avatar_url":"https://avatars.githubusercontent.com/u/1913131?v=3","gravatar_id":"","url":"https://api.github.com/users/TasukuNakano","html_url":"https://github.com/TasukuNakano","followers_url":"https://api.github.com/users/TasukuNakano/followers","following_url":"https://api.github.com/users/TasukuNakano/following{/other_user}","gists_url":"https://api.github.com/users/TasukuNakano/gists{/gist_id}","starred_url":"https://api.github.com/users/TasukuNakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TasukuNakano/subscriptions","organizations_url":"https://api.github.com/users/TasukuNakano/orgs","repos_url":"https://api.github.com/users/TasukuNakano/repos","events_url":"https://api.github.com/users/TasukuNakano/events{/privacy}","received_events_url":"https://api.github.com/users/TasukuNakano/received_events","type":"User","site_admin":false},"repo":{"id":51999965,"name":"perfect-ruby-on-rails","full_name":"TasukuNakano/perfect-ruby-on-rails","owner":{"login":"TasukuNakano","id":1913131,"avatar_url":"https://avatars.githubusercontent.com/u/1913131?v=3","gravatar_id":"","url":"https://api.github.com/users/TasukuNakano","html_url":"https://github.com/TasukuNakano","followers_url":"https://api.github.com/users/TasukuNakano/followers","following_url":"https://api.github.com/users/TasukuNakano/following{/other_user}","gists_url":"https://api.github.com/users/TasukuNakano/gists{/gist_id}","starred_url":"https://api.github.com/users/TasukuNakano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TasukuNakano/subscriptions","organizations_url":"https://api.github.com/users/TasukuNakano/orgs","repos_url":"https://api.github.com/users/TasukuNakano/repos","events_url":"https://api.github.com/users/TasukuNakano/events{/privacy}","received_events_url":"https://api.github.com/users/TasukuNakano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails","description":"パーフェクトRuby on Rails の写経用リポジトリ","fork":false,"url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails","forks_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/forks","keys_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/teams","hooks_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/hooks","issue_events_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/events{/number}","events_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/events","assignees_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/assignees{/user}","branches_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/branches{/branch}","tags_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/tags","blobs_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/refs{/sha}","trees_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/statuses/{sha}","languages_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/languages","stargazers_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/stargazers","contributors_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/contributors","subscribers_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/subscribers","subscription_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/subscription","commits_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/commits{/sha}","git_commits_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/git/commits{/sha}","comments_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/comments{/number}","issue_comment_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/comments{/number}","contents_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/contents/{+path}","compare_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/merges","archive_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/downloads","issues_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues{/number}","pulls_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls{/number}","milestones_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/milestones{/number}","notifications_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/labels{/name}","releases_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/releases{/id}","deployments_url":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/deployments","created_at":"2016-02-18T10:34:27Z","updated_at":"2016-02-23T08:55:13Z","pushed_at":"2016-02-24T18:47:35Z","git_url":"git://github.com/TasukuNakano/perfect-ruby-on-rails.git","ssh_url":"git@github.com:TasukuNakano/perfect-ruby-on-rails.git","clone_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails.git","svn_url":"https://github.com/TasukuNakano/perfect-ruby-on-rails","homepage":null,"size":94,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7"},"html":{"href":"https://github.com/TasukuNakano/perfect-ruby-on-rails/pull/7"},"issue":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/7"},"comments":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/TasukuNakano/perfect-ruby-on-rails/statuses/a1d106580c145a52c11b3b01af8314dc95a568aa"}}}}