{"action":"created","comment":{"url":"https://api.github.com/repos/Hunk13/flashcards/pulls/comments/38326409","id":38326409,"diff_hunk":"@@ -0,0 +1,29 @@\n+class OauthsController < ApplicationController\n+  skip_before_filter :require_login\n+\n+  def oauth\n+    login_at(auth_params[:provider])\n+  end\n+\n+  def callback\n+    provider = auth_params[:provider]\n+    if @user = login_from(provider)\n+      redirect_back_or_to root_path, :notice => \"Logged in from #{provider.titleize}!\"\n+    else\n+      begin\n+        @user = create_from(provider)\n+        reset_session\n+        auto_login(@user)\n+        redirect_back_or_to root_path, :notice => \"Logged in from #{provider.titleize}!\"\n+      rescue\n+        redirect_back_or_to root_path, :alert => \"Failed to login from #{provider.titleize}!\"\n+      end\n+    end\n+  end\n+\n+  private\n+\n+    def auth_params\n+      params.permit(:code, :provider)\n+    end\n+end","path":"app/controllers/oauths_controller.rb","position":29,"original_position":29,"commit_id":"52c884efda19a13461372f0aefb7f857da4df005","original_commit_id":"52c884efda19a13461372f0aefb7f857da4df005","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Final newline missing.","created_at":"2015-08-31T15:53:50Z","updated_at":"2015-08-31T15:53:50Z","html_url":"https://github.com/Hunk13/flashcards/pull/9#discussion_r38326409","pull_request_url":"https://api.github.com/repos/Hunk13/flashcards/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/Hunk13/flashcards/pulls/comments/38326409"},"html":{"href":"https://github.com/Hunk13/flashcards/pull/9#discussion_r38326409"},"pull_request":{"href":"https://api.github.com/repos/Hunk13/flashcards/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/Hunk13/flashcards/pulls/9","id":43776120,"html_url":"https://github.com/Hunk13/flashcards/pull/9","diff_url":"https://github.com/Hunk13/flashcards/pull/9.diff","patch_url":"https://github.com/Hunk13/flashcards/pull/9.patch","issue_url":"https://api.github.com/repos/Hunk13/flashcards/issues/9","number":9,"state":"open","locked":false,"title":"Ninth lesson","user":{"login":"Hunk13","id":2353427,"avatar_url":"https://avatars.githubusercontent.com/u/2353427?v=3","gravatar_id":"","url":"https://api.github.com/users/Hunk13","html_url":"https://github.com/Hunk13","followers_url":"https://api.github.com/users/Hunk13/followers","following_url":"https://api.github.com/users/Hunk13/following{/other_user}","gists_url":"https://api.github.com/users/Hunk13/gists{/gist_id}","starred_url":"https://api.github.com/users/Hunk13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hunk13/subscriptions","organizations_url":"https://api.github.com/users/Hunk13/orgs","repos_url":"https://api.github.com/users/Hunk13/repos","events_url":"https://api.github.com/users/Hunk13/events{/privacy}","received_events_url":"https://api.github.com/users/Hunk13/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-31T15:26:37Z","updated_at":"2015-08-31T15:53:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0991e7ce36860021896af6a79d59dd375882266c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Hunk13/flashcards/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Hunk13/flashcards/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Hunk13/flashcards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Hunk13/flashcards/issues/9/comments","statuses_url":"https://api.github.com/repos/Hunk13/flashcards/statuses/52c884efda19a13461372f0aefb7f857da4df005","head":{"label":"Hunk13:ninth-lesson","ref":"ninth-lesson","sha":"52c884efda19a13461372f0aefb7f857da4df005","user":{"login":"Hunk13","id":2353427,"avatar_url":"https://avatars.githubusercontent.com/u/2353427?v=3","gravatar_id":"","url":"https://api.github.com/users/Hunk13","html_url":"https://github.com/Hunk13","followers_url":"https://api.github.com/users/Hunk13/followers","following_url":"https://api.github.com/users/Hunk13/following{/other_user}","gists_url":"https://api.github.com/users/Hunk13/gists{/gist_id}","starred_url":"https://api.github.com/users/Hunk13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hunk13/subscriptions","organizations_url":"https://api.github.com/users/Hunk13/orgs","repos_url":"https://api.github.com/users/Hunk13/repos","events_url":"https://api.github.com/users/Hunk13/events{/privacy}","received_events_url":"https://api.github.com/users/Hunk13/received_events","type":"User","site_admin":false},"repo":{"id":38364862,"name":"flashcards","full_name":"Hunk13/flashcards","owner":{"login":"Hunk13","id":2353427,"avatar_url":"https://avatars.githubusercontent.com/u/2353427?v=3","gravatar_id":"","url":"https://api.github.com/users/Hunk13","html_url":"https://github.com/Hunk13","followers_url":"https://api.github.com/users/Hunk13/followers","following_url":"https://api.github.com/users/Hunk13/following{/other_user}","gists_url":"https://api.github.com/users/Hunk13/gists{/gist_id}","starred_url":"https://api.github.com/users/Hunk13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hunk13/subscriptions","organizations_url":"https://api.github.com/users/Hunk13/orgs","repos_url":"https://api.github.com/users/Hunk13/repos","events_url":"https://api.github.com/users/Hunk13/events{/privacy}","received_events_url":"https://api.github.com/users/Hunk13/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Hunk13/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/Hunk13/flashcards","forks_url":"https://api.github.com/repos/Hunk13/flashcards/forks","keys_url":"https://api.github.com/repos/Hunk13/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hunk13/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hunk13/flashcards/teams","hooks_url":"https://api.github.com/repos/Hunk13/flashcards/hooks","issue_events_url":"https://api.github.com/repos/Hunk13/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/Hunk13/flashcards/events","assignees_url":"https://api.github.com/repos/Hunk13/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/Hunk13/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/Hunk13/flashcards/tags","blobs_url":"https://api.github.com/repos/Hunk13/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hunk13/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hunk13/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hunk13/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hunk13/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/Hunk13/flashcards/languages","stargazers_url":"https://api.github.com/repos/Hunk13/flashcards/stargazers","contributors_url":"https://api.github.com/repos/Hunk13/flashcards/contributors","subscribers_url":"https://api.github.com/repos/Hunk13/flashcards/subscribers","subscription_url":"https://api.github.com/repos/Hunk13/flashcards/subscription","commits_url":"https://api.github.com/repos/Hunk13/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hunk13/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hunk13/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hunk13/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hunk13/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/Hunk13/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hunk13/flashcards/merges","archive_url":"https://api.github.com/repos/Hunk13/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hunk13/flashcards/downloads","issues_url":"https://api.github.com/repos/Hunk13/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/Hunk13/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/Hunk13/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/Hunk13/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hunk13/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/Hunk13/flashcards/releases{/id}","created_at":"2015-07-01T10:22:56Z","updated_at":"2015-07-01T10:41:09Z","pushed_at":"2015-08-31T15:53:43Z","git_url":"git://github.com/Hunk13/flashcards.git","ssh_url":"git@github.com:Hunk13/flashcards.git","clone_url":"https://github.com/Hunk13/flashcards.git","svn_url":"https://github.com/Hunk13/flashcards","homepage":null,"size":628,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Hunk13:master","ref":"master","sha":"cbbf161f22bd996482e81e59050fbd94b9374432","user":{"login":"Hunk13","id":2353427,"avatar_url":"https://avatars.githubusercontent.com/u/2353427?v=3","gravatar_id":"","url":"https://api.github.com/users/Hunk13","html_url":"https://github.com/Hunk13","followers_url":"https://api.github.com/users/Hunk13/followers","following_url":"https://api.github.com/users/Hunk13/following{/other_user}","gists_url":"https://api.github.com/users/Hunk13/gists{/gist_id}","starred_url":"https://api.github.com/users/Hunk13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hunk13/subscriptions","organizations_url":"https://api.github.com/users/Hunk13/orgs","repos_url":"https://api.github.com/users/Hunk13/repos","events_url":"https://api.github.com/users/Hunk13/events{/privacy}","received_events_url":"https://api.github.com/users/Hunk13/received_events","type":"User","site_admin":false},"repo":{"id":38364862,"name":"flashcards","full_name":"Hunk13/flashcards","owner":{"login":"Hunk13","id":2353427,"avatar_url":"https://avatars.githubusercontent.com/u/2353427?v=3","gravatar_id":"","url":"https://api.github.com/users/Hunk13","html_url":"https://github.com/Hunk13","followers_url":"https://api.github.com/users/Hunk13/followers","following_url":"https://api.github.com/users/Hunk13/following{/other_user}","gists_url":"https://api.github.com/users/Hunk13/gists{/gist_id}","starred_url":"https://api.github.com/users/Hunk13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hunk13/subscriptions","organizations_url":"https://api.github.com/users/Hunk13/orgs","repos_url":"https://api.github.com/users/Hunk13/repos","events_url":"https://api.github.com/users/Hunk13/events{/privacy}","received_events_url":"https://api.github.com/users/Hunk13/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Hunk13/flashcards","description":"","fork":false,"url":"https://api.github.com/repos/Hunk13/flashcards","forks_url":"https://api.github.com/repos/Hunk13/flashcards/forks","keys_url":"https://api.github.com/repos/Hunk13/flashcards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Hunk13/flashcards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Hunk13/flashcards/teams","hooks_url":"https://api.github.com/repos/Hunk13/flashcards/hooks","issue_events_url":"https://api.github.com/repos/Hunk13/flashcards/issues/events{/number}","events_url":"https://api.github.com/repos/Hunk13/flashcards/events","assignees_url":"https://api.github.com/repos/Hunk13/flashcards/assignees{/user}","branches_url":"https://api.github.com/repos/Hunk13/flashcards/branches{/branch}","tags_url":"https://api.github.com/repos/Hunk13/flashcards/tags","blobs_url":"https://api.github.com/repos/Hunk13/flashcards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Hunk13/flashcards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Hunk13/flashcards/git/refs{/sha}","trees_url":"https://api.github.com/repos/Hunk13/flashcards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Hunk13/flashcards/statuses/{sha}","languages_url":"https://api.github.com/repos/Hunk13/flashcards/languages","stargazers_url":"https://api.github.com/repos/Hunk13/flashcards/stargazers","contributors_url":"https://api.github.com/repos/Hunk13/flashcards/contributors","subscribers_url":"https://api.github.com/repos/Hunk13/flashcards/subscribers","subscription_url":"https://api.github.com/repos/Hunk13/flashcards/subscription","commits_url":"https://api.github.com/repos/Hunk13/flashcards/commits{/sha}","git_commits_url":"https://api.github.com/repos/Hunk13/flashcards/git/commits{/sha}","comments_url":"https://api.github.com/repos/Hunk13/flashcards/comments{/number}","issue_comment_url":"https://api.github.com/repos/Hunk13/flashcards/issues/comments{/number}","contents_url":"https://api.github.com/repos/Hunk13/flashcards/contents/{+path}","compare_url":"https://api.github.com/repos/Hunk13/flashcards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Hunk13/flashcards/merges","archive_url":"https://api.github.com/repos/Hunk13/flashcards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Hunk13/flashcards/downloads","issues_url":"https://api.github.com/repos/Hunk13/flashcards/issues{/number}","pulls_url":"https://api.github.com/repos/Hunk13/flashcards/pulls{/number}","milestones_url":"https://api.github.com/repos/Hunk13/flashcards/milestones{/number}","notifications_url":"https://api.github.com/repos/Hunk13/flashcards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Hunk13/flashcards/labels{/name}","releases_url":"https://api.github.com/repos/Hunk13/flashcards/releases{/id}","created_at":"2015-07-01T10:22:56Z","updated_at":"2015-07-01T10:41:09Z","pushed_at":"2015-08-31T15:53:43Z","git_url":"git://github.com/Hunk13/flashcards.git","ssh_url":"git@github.com:Hunk13/flashcards.git","clone_url":"https://github.com/Hunk13/flashcards.git","svn_url":"https://github.com/Hunk13/flashcards","homepage":null,"size":628,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Hunk13/flashcards/pulls/9"},"html":{"href":"https://github.com/Hunk13/flashcards/pull/9"},"issue":{"href":"https://api.github.com/repos/Hunk13/flashcards/issues/9"},"comments":{"href":"https://api.github.com/repos/Hunk13/flashcards/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Hunk13/flashcards/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Hunk13/flashcards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Hunk13/flashcards/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Hunk13/flashcards/statuses/52c884efda19a13461372f0aefb7f857da4df005"}}}}