{"action":"created","comment":{"url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/comments/52137785","id":52137785,"diff_hunk":"@@ -0,0 +1,54 @@\n+class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController\n+  # You should configure your model like this:\n+  # devise :omniauthable, omniauth_providers: [:twitter]\n+\n+  def self.provides_callback_for(provider)\n+    class_eval %Q{\n+      def #{provider}\n+        @user = User.find_for_oauth(env[\"omniauth.auth\"], current_user)\n+\n+        if @user.persisted?\n+          sign_in_and_redirect @user, event: :authentication\n+          set_flash_message(:notice, :success, kind: \"#{provider}\".capitalize) if is_navigational_format?\n+        else\n+          session[\"devise.#{provider}_data\"] = env[\"omniauth.auth\"]\n+          redirect_to new_user_registration_url\n+        end\n+      end\n+    }\n+  end","path":"app/controllers/users/omniauth_callbacks_controller.rb","position":19,"original_position":19,"commit_id":"8a98570e6f04e23501f4f706be6e7ecfd9d61925","original_commit_id":"8a98570e6f04e23501f4f706be6e7ecfd9d61925","user":{"login":"dmokreckiy","id":4544015,"avatar_url":"https://avatars.githubusercontent.com/u/4544015?v=3","gravatar_id":"","url":"https://api.github.com/users/dmokreckiy","html_url":"https://github.com/dmokreckiy","followers_url":"https://api.github.com/users/dmokreckiy/followers","following_url":"https://api.github.com/users/dmokreckiy/following{/other_user}","gists_url":"https://api.github.com/users/dmokreckiy/gists{/gist_id}","starred_url":"https://api.github.com/users/dmokreckiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmokreckiy/subscriptions","organizations_url":"https://api.github.com/users/dmokreckiy/orgs","repos_url":"https://api.github.com/users/dmokreckiy/repos","events_url":"https://api.github.com/users/dmokreckiy/events{/privacy}","received_events_url":"https://api.github.com/users/dmokreckiy/received_events","type":"User","site_admin":false},"body":"Give me a link where did you find this code.","created_at":"2016-02-08T07:13:32Z","updated_at":"2016-02-08T07:13:32Z","html_url":"https://github.com/dima-shutov-developer/Time-Manager/pull/2#discussion_r52137785","pull_request_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/comments/52137785"},"html":{"href":"https://github.com/dima-shutov-developer/Time-Manager/pull/2#discussion_r52137785"},"pull_request":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2","id":58557453,"html_url":"https://github.com/dima-shutov-developer/Time-Manager/pull/2","diff_url":"https://github.com/dima-shutov-developer/Time-Manager/pull/2.diff","patch_url":"https://github.com/dima-shutov-developer/Time-Manager/pull/2.patch","issue_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/2","number":2,"state":"closed","locked":false,"title":"Authentication","user":{"login":"dima-shutov-developer","id":11526199,"avatar_url":"https://avatars.githubusercontent.com/u/11526199?v=3","gravatar_id":"","url":"https://api.github.com/users/dima-shutov-developer","html_url":"https://github.com/dima-shutov-developer","followers_url":"https://api.github.com/users/dima-shutov-developer/followers","following_url":"https://api.github.com/users/dima-shutov-developer/following{/other_user}","gists_url":"https://api.github.com/users/dima-shutov-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/dima-shutov-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dima-shutov-developer/subscriptions","organizations_url":"https://api.github.com/users/dima-shutov-developer/orgs","repos_url":"https://api.github.com/users/dima-shutov-developer/repos","events_url":"https://api.github.com/users/dima-shutov-developer/events{/privacy}","received_events_url":"https://api.github.com/users/dima-shutov-developer/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-07T21:19:00Z","updated_at":"2016-02-08T07:13:32Z","closed_at":"2016-02-07T21:19:07Z","merged_at":"2016-02-07T21:19:07Z","merge_commit_sha":"d78d102da0a3293da64e6edc11c6e344bfa8cf51","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2/commits","review_comments_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2/comments","review_comment_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/2/comments","statuses_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/statuses/8a98570e6f04e23501f4f706be6e7ecfd9d61925","head":{"label":"dima-shutov-developer:Authentication","ref":"Authentication","sha":"8a98570e6f04e23501f4f706be6e7ecfd9d61925","user":{"login":"dima-shutov-developer","id":11526199,"avatar_url":"https://avatars.githubusercontent.com/u/11526199?v=3","gravatar_id":"","url":"https://api.github.com/users/dima-shutov-developer","html_url":"https://github.com/dima-shutov-developer","followers_url":"https://api.github.com/users/dima-shutov-developer/followers","following_url":"https://api.github.com/users/dima-shutov-developer/following{/other_user}","gists_url":"https://api.github.com/users/dima-shutov-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/dima-shutov-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dima-shutov-developer/subscriptions","organizations_url":"https://api.github.com/users/dima-shutov-developer/orgs","repos_url":"https://api.github.com/users/dima-shutov-developer/repos","events_url":"https://api.github.com/users/dima-shutov-developer/events{/privacy}","received_events_url":"https://api.github.com/users/dima-shutov-developer/received_events","type":"User","site_admin":false},"repo":{"id":50777423,"name":"Time-Manager","full_name":"dima-shutov-developer/Time-Manager","owner":{"login":"dima-shutov-developer","id":11526199,"avatar_url":"https://avatars.githubusercontent.com/u/11526199?v=3","gravatar_id":"","url":"https://api.github.com/users/dima-shutov-developer","html_url":"https://github.com/dima-shutov-developer","followers_url":"https://api.github.com/users/dima-shutov-developer/followers","following_url":"https://api.github.com/users/dima-shutov-developer/following{/other_user}","gists_url":"https://api.github.com/users/dima-shutov-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/dima-shutov-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dima-shutov-developer/subscriptions","organizations_url":"https://api.github.com/users/dima-shutov-developer/orgs","repos_url":"https://api.github.com/users/dima-shutov-developer/repos","events_url":"https://api.github.com/users/dima-shutov-developer/events{/privacy}","received_events_url":"https://api.github.com/users/dima-shutov-developer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dima-shutov-developer/Time-Manager","description":"","fork":false,"url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager","forks_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/forks","keys_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/teams","hooks_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/hooks","issue_events_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/events{/number}","events_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/events","assignees_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/assignees{/user}","branches_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/branches{/branch}","tags_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/tags","blobs_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/statuses/{sha}","languages_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/languages","stargazers_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/stargazers","contributors_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/contributors","subscribers_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/subscribers","subscription_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/subscription","commits_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/contents/{+path}","compare_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/merges","archive_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/downloads","issues_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues{/number}","pulls_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls{/number}","milestones_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/milestones{/number}","notifications_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/labels{/name}","releases_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/releases{/id}","deployments_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/deployments","created_at":"2016-01-31T14:06:41Z","updated_at":"2016-01-31T19:11:51Z","pushed_at":"2016-02-07T21:19:08Z","git_url":"git://github.com/dima-shutov-developer/Time-Manager.git","ssh_url":"git@github.com:dima-shutov-developer/Time-Manager.git","clone_url":"https://github.com/dima-shutov-developer/Time-Manager.git","svn_url":"https://github.com/dima-shutov-developer/Time-Manager","homepage":null,"size":53,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dima-shutov-developer:master","ref":"master","sha":"92750dc88dab621dcaa78218c2f3021d92a04e08","user":{"login":"dima-shutov-developer","id":11526199,"avatar_url":"https://avatars.githubusercontent.com/u/11526199?v=3","gravatar_id":"","url":"https://api.github.com/users/dima-shutov-developer","html_url":"https://github.com/dima-shutov-developer","followers_url":"https://api.github.com/users/dima-shutov-developer/followers","following_url":"https://api.github.com/users/dima-shutov-developer/following{/other_user}","gists_url":"https://api.github.com/users/dima-shutov-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/dima-shutov-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dima-shutov-developer/subscriptions","organizations_url":"https://api.github.com/users/dima-shutov-developer/orgs","repos_url":"https://api.github.com/users/dima-shutov-developer/repos","events_url":"https://api.github.com/users/dima-shutov-developer/events{/privacy}","received_events_url":"https://api.github.com/users/dima-shutov-developer/received_events","type":"User","site_admin":false},"repo":{"id":50777423,"name":"Time-Manager","full_name":"dima-shutov-developer/Time-Manager","owner":{"login":"dima-shutov-developer","id":11526199,"avatar_url":"https://avatars.githubusercontent.com/u/11526199?v=3","gravatar_id":"","url":"https://api.github.com/users/dima-shutov-developer","html_url":"https://github.com/dima-shutov-developer","followers_url":"https://api.github.com/users/dima-shutov-developer/followers","following_url":"https://api.github.com/users/dima-shutov-developer/following{/other_user}","gists_url":"https://api.github.com/users/dima-shutov-developer/gists{/gist_id}","starred_url":"https://api.github.com/users/dima-shutov-developer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dima-shutov-developer/subscriptions","organizations_url":"https://api.github.com/users/dima-shutov-developer/orgs","repos_url":"https://api.github.com/users/dima-shutov-developer/repos","events_url":"https://api.github.com/users/dima-shutov-developer/events{/privacy}","received_events_url":"https://api.github.com/users/dima-shutov-developer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dima-shutov-developer/Time-Manager","description":"","fork":false,"url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager","forks_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/forks","keys_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/teams","hooks_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/hooks","issue_events_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/events{/number}","events_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/events","assignees_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/assignees{/user}","branches_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/branches{/branch}","tags_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/tags","blobs_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/statuses/{sha}","languages_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/languages","stargazers_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/stargazers","contributors_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/contributors","subscribers_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/subscribers","subscription_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/subscription","commits_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/contents/{+path}","compare_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/merges","archive_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/downloads","issues_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues{/number}","pulls_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls{/number}","milestones_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/milestones{/number}","notifications_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/labels{/name}","releases_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/releases{/id}","deployments_url":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/deployments","created_at":"2016-01-31T14:06:41Z","updated_at":"2016-01-31T19:11:51Z","pushed_at":"2016-02-07T21:19:08Z","git_url":"git://github.com/dima-shutov-developer/Time-Manager.git","ssh_url":"git@github.com:dima-shutov-developer/Time-Manager.git","clone_url":"https://github.com/dima-shutov-developer/Time-Manager.git","svn_url":"https://github.com/dima-shutov-developer/Time-Manager","homepage":null,"size":53,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2"},"html":{"href":"https://github.com/dima-shutov-developer/Time-Manager/pull/2"},"issue":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/2"},"comments":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/dima-shutov-developer/Time-Manager/statuses/8a98570e6f04e23501f4f706be6e7ecfd9d61925"}}}}