{"action":"created","comment":{"url":"https://api.github.com/repos/crowdint/spree_sam/pulls/comments/37022845","id":37022845,"diff_hunk":"@@ -0,0 +1,64 @@\n+module Spree\n+  module Api\n+    module V1\n+      class UserSessionsController < Devise::SessionsController\n+        skip_before_action :verify_authenticity_token\n+\n+        respond_to :json\n+\n+        def create\n+          authenticate_spree_user!\n+\n+          if spree_user_signed_in?\n+            respond_to do |format|\n+              format.html {\n+                flash[:success] = Spree.t(:logged_in_succesfully)\n+                redirect_back_or_default(after_sign_in_path_for(spree_current_user))\n+              }\n+              format.js {\n+                render json: { user: spree_current_user,\n+                               ship_address: spree_current_user.ship_address,\n+                               bill_address: spree_current_user.bill_address }.to_json\n+              }\n+              format.json {\n+                render json: { success: true,","path":"app/controllers/spree/api/v1/user_sessions_controller.rb","position":24,"original_position":24,"commit_id":"806db7196b750301324a05713d4088ce30062784","original_commit_id":"806db7196b750301324a05713d4088ce30062784","user":{"login":"softr8","id":127449,"avatar_url":"https://avatars.githubusercontent.com/u/127449?v=3","gravatar_id":"","url":"https://api.github.com/users/softr8","html_url":"https://github.com/softr8","followers_url":"https://api.github.com/users/softr8/followers","following_url":"https://api.github.com/users/softr8/following{/other_user}","gists_url":"https://api.github.com/users/softr8/gists{/gist_id}","starred_url":"https://api.github.com/users/softr8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/softr8/subscriptions","organizations_url":"https://api.github.com/users/softr8/orgs","repos_url":"https://api.github.com/users/softr8/repos","events_url":"https://api.github.com/users/softr8/events{/privacy}","received_events_url":"https://api.github.com/users/softr8/received_events","type":"User","site_admin":false},"body":"I dont think we need to return success: true, we already have status code, the client should validate that, so with the format.js should be enough ","created_at":"2015-08-13T20:43:18Z","updated_at":"2015-08-13T20:43:18Z","html_url":"https://github.com/crowdint/spree_sam/pull/1#discussion_r37022845","pull_request_url":"https://api.github.com/repos/crowdint/spree_sam/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/crowdint/spree_sam/pulls/comments/37022845"},"html":{"href":"https://github.com/crowdint/spree_sam/pull/1#discussion_r37022845"},"pull_request":{"href":"https://api.github.com/repos/crowdint/spree_sam/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/crowdint/spree_sam/pulls/1","id":42395455,"html_url":"https://github.com/crowdint/spree_sam/pull/1","diff_url":"https://github.com/crowdint/spree_sam/pull/1.diff","patch_url":"https://github.com/crowdint/spree_sam/pull/1.patch","issue_url":"https://api.github.com/repos/crowdint/spree_sam/issues/1","number":1,"state":"open","locked":false,"title":"Add endpoint to sign_in and sign_out via API","user":{"login":"jtapia","id":957520,"avatar_url":"https://avatars.githubusercontent.com/u/957520?v=3","gravatar_id":"","url":"https://api.github.com/users/jtapia","html_url":"https://github.com/jtapia","followers_url":"https://api.github.com/users/jtapia/followers","following_url":"https://api.github.com/users/jtapia/following{/other_user}","gists_url":"https://api.github.com/users/jtapia/gists{/gist_id}","starred_url":"https://api.github.com/users/jtapia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtapia/subscriptions","organizations_url":"https://api.github.com/users/jtapia/orgs","repos_url":"https://api.github.com/users/jtapia/repos","events_url":"https://api.github.com/users/jtapia/events{/privacy}","received_events_url":"https://api.github.com/users/jtapia/received_events","type":"User","site_admin":false},"body":"You need to use `/api/v1/spree_user/sign_in` same params `spree_user: { email: 'email', password: 'password' }`","created_at":"2015-08-13T20:31:26Z","updated_at":"2015-08-13T20:43:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"240de1849f6fed5555e0f0f738ff6536ae23d7cc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/crowdint/spree_sam/pulls/1/commits","review_comments_url":"https://api.github.com/repos/crowdint/spree_sam/pulls/1/comments","review_comment_url":"https://api.github.com/repos/crowdint/spree_sam/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crowdint/spree_sam/issues/1/comments","statuses_url":"https://api.github.com/repos/crowdint/spree_sam/statuses/806db7196b750301324a05713d4088ce30062784","head":{"label":"jtapia:master","ref":"master","sha":"806db7196b750301324a05713d4088ce30062784","user":{"login":"jtapia","id":957520,"avatar_url":"https://avatars.githubusercontent.com/u/957520?v=3","gravatar_id":"","url":"https://api.github.com/users/jtapia","html_url":"https://github.com/jtapia","followers_url":"https://api.github.com/users/jtapia/followers","following_url":"https://api.github.com/users/jtapia/following{/other_user}","gists_url":"https://api.github.com/users/jtapia/gists{/gist_id}","starred_url":"https://api.github.com/users/jtapia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtapia/subscriptions","organizations_url":"https://api.github.com/users/jtapia/orgs","repos_url":"https://api.github.com/users/jtapia/repos","events_url":"https://api.github.com/users/jtapia/events{/privacy}","received_events_url":"https://api.github.com/users/jtapia/received_events","type":"User","site_admin":false},"repo":{"id":40568702,"name":"spree_sam","full_name":"jtapia/spree_sam","owner":{"login":"jtapia","id":957520,"avatar_url":"https://avatars.githubusercontent.com/u/957520?v=3","gravatar_id":"","url":"https://api.github.com/users/jtapia","html_url":"https://github.com/jtapia","followers_url":"https://api.github.com/users/jtapia/followers","following_url":"https://api.github.com/users/jtapia/following{/other_user}","gists_url":"https://api.github.com/users/jtapia/gists{/gist_id}","starred_url":"https://api.github.com/users/jtapia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtapia/subscriptions","organizations_url":"https://api.github.com/users/jtapia/orgs","repos_url":"https://api.github.com/users/jtapia/repos","events_url":"https://api.github.com/users/jtapia/events{/privacy}","received_events_url":"https://api.github.com/users/jtapia/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jtapia/spree_sam","description":"","fork":true,"url":"https://api.github.com/repos/jtapia/spree_sam","forks_url":"https://api.github.com/repos/jtapia/spree_sam/forks","keys_url":"https://api.github.com/repos/jtapia/spree_sam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jtapia/spree_sam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jtapia/spree_sam/teams","hooks_url":"https://api.github.com/repos/jtapia/spree_sam/hooks","issue_events_url":"https://api.github.com/repos/jtapia/spree_sam/issues/events{/number}","events_url":"https://api.github.com/repos/jtapia/spree_sam/events","assignees_url":"https://api.github.com/repos/jtapia/spree_sam/assignees{/user}","branches_url":"https://api.github.com/repos/jtapia/spree_sam/branches{/branch}","tags_url":"https://api.github.com/repos/jtapia/spree_sam/tags","blobs_url":"https://api.github.com/repos/jtapia/spree_sam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jtapia/spree_sam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jtapia/spree_sam/git/refs{/sha}","trees_url":"https://api.github.com/repos/jtapia/spree_sam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jtapia/spree_sam/statuses/{sha}","languages_url":"https://api.github.com/repos/jtapia/spree_sam/languages","stargazers_url":"https://api.github.com/repos/jtapia/spree_sam/stargazers","contributors_url":"https://api.github.com/repos/jtapia/spree_sam/contributors","subscribers_url":"https://api.github.com/repos/jtapia/spree_sam/subscribers","subscription_url":"https://api.github.com/repos/jtapia/spree_sam/subscription","commits_url":"https://api.github.com/repos/jtapia/spree_sam/commits{/sha}","git_commits_url":"https://api.github.com/repos/jtapia/spree_sam/git/commits{/sha}","comments_url":"https://api.github.com/repos/jtapia/spree_sam/comments{/number}","issue_comment_url":"https://api.github.com/repos/jtapia/spree_sam/issues/comments{/number}","contents_url":"https://api.github.com/repos/jtapia/spree_sam/contents/{+path}","compare_url":"https://api.github.com/repos/jtapia/spree_sam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jtapia/spree_sam/merges","archive_url":"https://api.github.com/repos/jtapia/spree_sam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jtapia/spree_sam/downloads","issues_url":"https://api.github.com/repos/jtapia/spree_sam/issues{/number}","pulls_url":"https://api.github.com/repos/jtapia/spree_sam/pulls{/number}","milestones_url":"https://api.github.com/repos/jtapia/spree_sam/milestones{/number}","notifications_url":"https://api.github.com/repos/jtapia/spree_sam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jtapia/spree_sam/labels{/name}","releases_url":"https://api.github.com/repos/jtapia/spree_sam/releases{/id}","created_at":"2015-08-11T22:41:31Z","updated_at":"2015-08-11T22:41:31Z","pushed_at":"2015-08-13T20:34:23Z","git_url":"git://github.com/jtapia/spree_sam.git","ssh_url":"git@github.com:jtapia/spree_sam.git","clone_url":"https://github.com/jtapia/spree_sam.git","svn_url":"https://github.com/jtapia/spree_sam","homepage":null,"size":63,"stargazers_count":0,"watchers_count":0,"language":"Ruby","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":"crowdint:master","ref":"master","sha":"6fac92f49293cde9771f03b7b3996a8558f10aa9","user":{"login":"crowdint","id":333603,"avatar_url":"https://avatars.githubusercontent.com/u/333603?v=3","gravatar_id":"","url":"https://api.github.com/users/crowdint","html_url":"https://github.com/crowdint","followers_url":"https://api.github.com/users/crowdint/followers","following_url":"https://api.github.com/users/crowdint/following{/other_user}","gists_url":"https://api.github.com/users/crowdint/gists{/gist_id}","starred_url":"https://api.github.com/users/crowdint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowdint/subscriptions","organizations_url":"https://api.github.com/users/crowdint/orgs","repos_url":"https://api.github.com/users/crowdint/repos","events_url":"https://api.github.com/users/crowdint/events{/privacy}","received_events_url":"https://api.github.com/users/crowdint/received_events","type":"Organization","site_admin":false},"repo":{"id":40320893,"name":"spree_sam","full_name":"crowdint/spree_sam","owner":{"login":"crowdint","id":333603,"avatar_url":"https://avatars.githubusercontent.com/u/333603?v=3","gravatar_id":"","url":"https://api.github.com/users/crowdint","html_url":"https://github.com/crowdint","followers_url":"https://api.github.com/users/crowdint/followers","following_url":"https://api.github.com/users/crowdint/following{/other_user}","gists_url":"https://api.github.com/users/crowdint/gists{/gist_id}","starred_url":"https://api.github.com/users/crowdint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crowdint/subscriptions","organizations_url":"https://api.github.com/users/crowdint/orgs","repos_url":"https://api.github.com/users/crowdint/repos","events_url":"https://api.github.com/users/crowdint/events{/privacy}","received_events_url":"https://api.github.com/users/crowdint/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crowdint/spree_sam","description":"","fork":false,"url":"https://api.github.com/repos/crowdint/spree_sam","forks_url":"https://api.github.com/repos/crowdint/spree_sam/forks","keys_url":"https://api.github.com/repos/crowdint/spree_sam/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crowdint/spree_sam/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crowdint/spree_sam/teams","hooks_url":"https://api.github.com/repos/crowdint/spree_sam/hooks","issue_events_url":"https://api.github.com/repos/crowdint/spree_sam/issues/events{/number}","events_url":"https://api.github.com/repos/crowdint/spree_sam/events","assignees_url":"https://api.github.com/repos/crowdint/spree_sam/assignees{/user}","branches_url":"https://api.github.com/repos/crowdint/spree_sam/branches{/branch}","tags_url":"https://api.github.com/repos/crowdint/spree_sam/tags","blobs_url":"https://api.github.com/repos/crowdint/spree_sam/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crowdint/spree_sam/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crowdint/spree_sam/git/refs{/sha}","trees_url":"https://api.github.com/repos/crowdint/spree_sam/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crowdint/spree_sam/statuses/{sha}","languages_url":"https://api.github.com/repos/crowdint/spree_sam/languages","stargazers_url":"https://api.github.com/repos/crowdint/spree_sam/stargazers","contributors_url":"https://api.github.com/repos/crowdint/spree_sam/contributors","subscribers_url":"https://api.github.com/repos/crowdint/spree_sam/subscribers","subscription_url":"https://api.github.com/repos/crowdint/spree_sam/subscription","commits_url":"https://api.github.com/repos/crowdint/spree_sam/commits{/sha}","git_commits_url":"https://api.github.com/repos/crowdint/spree_sam/git/commits{/sha}","comments_url":"https://api.github.com/repos/crowdint/spree_sam/comments{/number}","issue_comment_url":"https://api.github.com/repos/crowdint/spree_sam/issues/comments{/number}","contents_url":"https://api.github.com/repos/crowdint/spree_sam/contents/{+path}","compare_url":"https://api.github.com/repos/crowdint/spree_sam/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crowdint/spree_sam/merges","archive_url":"https://api.github.com/repos/crowdint/spree_sam/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crowdint/spree_sam/downloads","issues_url":"https://api.github.com/repos/crowdint/spree_sam/issues{/number}","pulls_url":"https://api.github.com/repos/crowdint/spree_sam/pulls{/number}","milestones_url":"https://api.github.com/repos/crowdint/spree_sam/milestones{/number}","notifications_url":"https://api.github.com/repos/crowdint/spree_sam/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crowdint/spree_sam/labels{/name}","releases_url":"https://api.github.com/repos/crowdint/spree_sam/releases{/id}","created_at":"2015-08-06T18:33:58Z","updated_at":"2015-08-06T19:17:27Z","pushed_at":"2015-08-13T20:34:24Z","git_url":"git://github.com/crowdint/spree_sam.git","ssh_url":"git@github.com:crowdint/spree_sam.git","clone_url":"https://github.com/crowdint/spree_sam.git","svn_url":"https://github.com/crowdint/spree_sam","homepage":null,"size":93,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/crowdint/spree_sam/pulls/1"},"html":{"href":"https://github.com/crowdint/spree_sam/pull/1"},"issue":{"href":"https://api.github.com/repos/crowdint/spree_sam/issues/1"},"comments":{"href":"https://api.github.com/repos/crowdint/spree_sam/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/crowdint/spree_sam/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/crowdint/spree_sam/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crowdint/spree_sam/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/crowdint/spree_sam/statuses/806db7196b750301324a05713d4088ce30062784"}}}}