{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/payments-ui/pulls/comments/32032552","id":32032552,"diff_hunk":"@@ -29,9 +29,17 @@ module.exports = React.createClass({\n       method: 'post',\n       url: '/api/auth/sign-in/',\n       context: this,\n-    }).then(function() {\n+    }).then(function(data) {\n       if (this.isMounted()) {\n         this.setState({'is_logged_in': true}); // eslint-disable-line\n+\n+        console.log('setting CSRF token for subsequent requests:', data.csrf_token);\n+        $.ajaxSetup({","path":"public/jsx/views/login.jsx","position":10,"original_position":10,"commit_id":"21552ea88ccc528d743b37c04f8716ec83af1af1","original_commit_id":"21552ea88ccc528d743b37c04f8716ec83af1af1","user":{"login":"muffinresearch","id":1514,"avatar_url":"https://avatars.githubusercontent.com/u/1514?v=3","gravatar_id":"","url":"https://api.github.com/users/muffinresearch","html_url":"https://github.com/muffinresearch","followers_url":"https://api.github.com/users/muffinresearch/followers","following_url":"https://api.github.com/users/muffinresearch/following{/other_user}","gists_url":"https://api.github.com/users/muffinresearch/gists{/gist_id}","starred_url":"https://api.github.com/users/muffinresearch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/muffinresearch/subscriptions","organizations_url":"https://api.github.com/users/muffinresearch/orgs","repos_url":"https://api.github.com/users/muffinresearch/repos","events_url":"https://api.github.com/users/muffinresearch/events{/privacy}","received_events_url":"https://api.github.com/users/muffinresearch/received_events","type":"User","site_admin":false},"body":"Presumably this is going to add the header and not unset the dataType setting? We're already running it here: https://github.com/mozilla/payments-ui/blob/master/public/js/main.js#L7","created_at":"2015-06-09T16:24:11Z","updated_at":"2015-06-09T16:24:11Z","html_url":"https://github.com/mozilla/payments-ui/pull/91#discussion_r32032552","pull_request_url":"https://api.github.com/repos/mozilla/payments-ui/pulls/91","_links":{"self":{"href":"https://api.github.com/repos/mozilla/payments-ui/pulls/comments/32032552"},"html":{"href":"https://github.com/mozilla/payments-ui/pull/91#discussion_r32032552"},"pull_request":{"href":"https://api.github.com/repos/mozilla/payments-ui/pulls/91"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/payments-ui/pulls/91","id":37271737,"html_url":"https://github.com/mozilla/payments-ui/pull/91","diff_url":"https://github.com/mozilla/payments-ui/pull/91.diff","patch_url":"https://github.com/mozilla/payments-ui/pull/91.patch","issue_url":"https://api.github.com/repos/mozilla/payments-ui/issues/91","number":91,"state":"open","locked":false,"title":"Store and send CSRF tokens to the API","user":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"body":"Part of https://github.com/mozilla/payments-service/issues/46\r\n\r\nI can't think of an easy way to test this. Any ideas?\r\n\r\nGoing forward, I think we could make an API abstraction (perhaps around fetch, see https://github.com/mozilla/payments-ui/issues/84). If we design the abstraction with testability in mind we could stub it out in tests so that components are fed mock return data. This would allow the tests to make assertions about what components do with the data.","created_at":"2015-06-09T16:20:08Z","updated_at":"2015-06-09T16:24:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2bddec2916a7aa604e75c5e1174e4cee5983f628","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/payments-ui/pulls/91/commits","review_comments_url":"https://api.github.com/repos/mozilla/payments-ui/pulls/91/comments","review_comment_url":"https://api.github.com/repos/mozilla/payments-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/payments-ui/issues/91/comments","statuses_url":"https://api.github.com/repos/mozilla/payments-ui/statuses/21552ea88ccc528d743b37c04f8716ec83af1af1","head":{"label":"kumar303:csrf","ref":"csrf","sha":"21552ea88ccc528d743b37c04f8716ec83af1af1","user":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"repo":{"id":36034950,"name":"payments-ui","full_name":"kumar303/payments-ui","owner":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kumar303/payments-ui","description":"The payments frontend interface","fork":true,"url":"https://api.github.com/repos/kumar303/payments-ui","forks_url":"https://api.github.com/repos/kumar303/payments-ui/forks","keys_url":"https://api.github.com/repos/kumar303/payments-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kumar303/payments-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kumar303/payments-ui/teams","hooks_url":"https://api.github.com/repos/kumar303/payments-ui/hooks","issue_events_url":"https://api.github.com/repos/kumar303/payments-ui/issues/events{/number}","events_url":"https://api.github.com/repos/kumar303/payments-ui/events","assignees_url":"https://api.github.com/repos/kumar303/payments-ui/assignees{/user}","branches_url":"https://api.github.com/repos/kumar303/payments-ui/branches{/branch}","tags_url":"https://api.github.com/repos/kumar303/payments-ui/tags","blobs_url":"https://api.github.com/repos/kumar303/payments-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kumar303/payments-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kumar303/payments-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/kumar303/payments-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kumar303/payments-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/kumar303/payments-ui/languages","stargazers_url":"https://api.github.com/repos/kumar303/payments-ui/stargazers","contributors_url":"https://api.github.com/repos/kumar303/payments-ui/contributors","subscribers_url":"https://api.github.com/repos/kumar303/payments-ui/subscribers","subscription_url":"https://api.github.com/repos/kumar303/payments-ui/subscription","commits_url":"https://api.github.com/repos/kumar303/payments-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/kumar303/payments-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/kumar303/payments-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/kumar303/payments-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/kumar303/payments-ui/contents/{+path}","compare_url":"https://api.github.com/repos/kumar303/payments-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kumar303/payments-ui/merges","archive_url":"https://api.github.com/repos/kumar303/payments-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kumar303/payments-ui/downloads","issues_url":"https://api.github.com/repos/kumar303/payments-ui/issues{/number}","pulls_url":"https://api.github.com/repos/kumar303/payments-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/kumar303/payments-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/kumar303/payments-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kumar303/payments-ui/labels{/name}","releases_url":"https://api.github.com/repos/kumar303/payments-ui/releases{/id}","created_at":"2015-05-21T20:09:38Z","updated_at":"2015-05-21T20:09:39Z","pushed_at":"2015-06-09T16:16:59Z","git_url":"git://github.com/kumar303/payments-ui.git","ssh_url":"git@github.com:kumar303/payments-ui.git","clone_url":"https://github.com/kumar303/payments-ui.git","svn_url":"https://github.com/kumar303/payments-ui","homepage":null,"size":12768,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"570e51407cfad91bd13588bc73636a843ef86e95","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":34340650,"name":"payments-ui","full_name":"mozilla/payments-ui","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/payments-ui","description":"The payments frontend interface","fork":false,"url":"https://api.github.com/repos/mozilla/payments-ui","forks_url":"https://api.github.com/repos/mozilla/payments-ui/forks","keys_url":"https://api.github.com/repos/mozilla/payments-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/payments-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/payments-ui/teams","hooks_url":"https://api.github.com/repos/mozilla/payments-ui/hooks","issue_events_url":"https://api.github.com/repos/mozilla/payments-ui/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/payments-ui/events","assignees_url":"https://api.github.com/repos/mozilla/payments-ui/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/payments-ui/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/payments-ui/tags","blobs_url":"https://api.github.com/repos/mozilla/payments-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/payments-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/payments-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/payments-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/payments-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/payments-ui/languages","stargazers_url":"https://api.github.com/repos/mozilla/payments-ui/stargazers","contributors_url":"https://api.github.com/repos/mozilla/payments-ui/contributors","subscribers_url":"https://api.github.com/repos/mozilla/payments-ui/subscribers","subscription_url":"https://api.github.com/repos/mozilla/payments-ui/subscription","commits_url":"https://api.github.com/repos/mozilla/payments-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/payments-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/payments-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/payments-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/payments-ui/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/payments-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/payments-ui/merges","archive_url":"https://api.github.com/repos/mozilla/payments-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/payments-ui/downloads","issues_url":"https://api.github.com/repos/mozilla/payments-ui/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/payments-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/payments-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/payments-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/payments-ui/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/payments-ui/releases{/id}","created_at":"2015-04-21T17:07:06Z","updated_at":"2015-05-21T15:00:09Z","pushed_at":"2015-06-09T16:20:08Z","git_url":"git://github.com/mozilla/payments-ui.git","ssh_url":"git@github.com:mozilla/payments-ui.git","clone_url":"https://github.com/mozilla/payments-ui.git","svn_url":"https://github.com/mozilla/payments-ui","homepage":null,"size":14711,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":3,"mirror_url":null,"open_issues_count":23,"forks":3,"open_issues":23,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/payments-ui/pulls/91"},"html":{"href":"https://github.com/mozilla/payments-ui/pull/91"},"issue":{"href":"https://api.github.com/repos/mozilla/payments-ui/issues/91"},"comments":{"href":"https://api.github.com/repos/mozilla/payments-ui/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/payments-ui/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/payments-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/payments-ui/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/payments-ui/statuses/21552ea88ccc528d743b37c04f8716ec83af1af1"}}}}