{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments/51160311","id":51160311,"diff_hunk":"@@ -217,14 +231,24 @@ define(function (require, exports, module) {\n       var self = this;\n       return p()\n         .then(function () {\n-          if (! self._isUserOldEnough()) {\n-            self.notifier.trigger('signup.tooyoung');\n-\n-            return self._cannotCreateAccount();\n+          if (self._isUserOldEnough()) {\n+            self.notifier.trigger('signup.submit');\n+            return self._initAccount(signUp);\n           }\n-          self.notifier.trigger('signup.submit');\n \n-          return self._initAccount();\n+          // COPPA is not valid, but maybe this is an existing user\n+          // that wants to sign in. Let them try to sign in then, if\n+          // that fails, come back here and show the COPPA error.\n+          // https://github.com/mozilla/fxa-content-server/issues/2778\n+          return self._initAccount(signIn)\n+            .fail(function (err) {\n+              if (self._coppa.hasValue()) {","path":"app/scripts/views/sign_up.js","position":77,"original_position":77,"commit_id":"d9a50cf815c309452e3afbefc32a09a1a7b140ac","original_commit_id":"52c09cb86117c84dd3ca50e5e83818417f6dedf3","user":{"login":"philbooth","id":64367,"avatar_url":"https://avatars.githubusercontent.com/u/64367?v=3","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false},"body":"Argh, excellent point. On it.","created_at":"2016-01-28T18:02:43Z","updated_at":"2016-01-28T18:02:43Z","html_url":"https://github.com/mozilla/fxa-content-server/pull/3413#discussion_r51160311","pull_request_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413","_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments/51160311"},"html":{"href":"https://github.com/mozilla/fxa-content-server/pull/3413#discussion_r51160311"},"pull_request":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413","id":56878262,"html_url":"https://github.com/mozilla/fxa-content-server/pull/3413","diff_url":"https://github.com/mozilla/fxa-content-server/pull/3413.diff","patch_url":"https://github.com/mozilla/fxa-content-server/pull/3413.patch","issue_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/3413","number":3413,"state":"open","locked":false,"title":"feat(client): allow users to sign in from sign-up view","user":{"login":"philbooth","id":64367,"avatar_url":"https://avatars.githubusercontent.com/u/64367?v=3","gravatar_id":"","url":"https://api.github.com/users/philbooth","html_url":"https://github.com/philbooth","followers_url":"https://api.github.com/users/philbooth/followers","following_url":"https://api.github.com/users/philbooth/following{/other_user}","gists_url":"https://api.github.com/users/philbooth/gists{/gist_id}","starred_url":"https://api.github.com/users/philbooth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philbooth/subscriptions","organizations_url":"https://api.github.com/users/philbooth/orgs","repos_url":"https://api.github.com/users/philbooth/repos","events_url":"https://api.github.com/users/philbooth/events{/privacy}","received_events_url":"https://api.github.com/users/philbooth/received_events","type":"User","site_admin":false},"body":"Fixes #2778.\r\n\r\n@shane-tomlinson, if you can spare a moment, would you mind casting your eye over this for me? I haven't sorted tests out yet, just want to know if I'm going in the right direction with the implementation.\r\n\r\nThe different flows are confusing (I find), so I'll list them here:\r\n\r\n1. User fills out sign-up form correctly, account exists, credentials are correct: User is signed in\r\n2. User fills out sign-up form correctly, account exists, credentials are wrong: `Account already exists` error\r\n3. User fails to enter COPPA age, sign-in succeeds: User is signed in\r\n4. User fails to enter COPPA age, sign-in fails: `Enter your age` error\r\n5. User enters too-young COPPA age, sign-in succeeds: User is signed in\r\n6. User enters too-young COPPA age, sign-in fails: `tooyoung` cookie is set, navigates to `/cannot_create_account`\r\n\r\nThe above all work (he says), so feel free to checkout the branch and run it locally if it helps.\r\n\r\nParticular things I wasn't sure about and am looking for feedback on:\r\n\r\n* Those flows.\r\n* Creating `signup-success-mixin` vs some other approach to code re-use.\r\n* Exporting an initialisation function from `signup-success-mixin.js` rather than the mixin directly, in order to parameterise its implementation.\r\n* Refactoring to the `actions` object in the sign-up view in order to simplify the promise chain elsewhere in the module. This one is especially ugly, what should I do instead?\r\n* For naming consistency, changing the capitalisation of some other mixins (I recall we agreed that the `In` and `Up` parts should be captialised during the inter-tab work).\r\n* And anything else you spot, of course. :grin: \r\n","created_at":"2016-01-22T11:49:19Z","updated_at":"2016-01-28T18:02:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46773ca1628898365bae97b76b055f9923f23d80","assignee":{"login":"shane-tomlinson","id":848085,"avatar_url":"https://avatars.githubusercontent.com/u/848085?v=3","gravatar_id":"","url":"https://api.github.com/users/shane-tomlinson","html_url":"https://github.com/shane-tomlinson","followers_url":"https://api.github.com/users/shane-tomlinson/followers","following_url":"https://api.github.com/users/shane-tomlinson/following{/other_user}","gists_url":"https://api.github.com/users/shane-tomlinson/gists{/gist_id}","starred_url":"https://api.github.com/users/shane-tomlinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shane-tomlinson/subscriptions","organizations_url":"https://api.github.com/users/shane-tomlinson/orgs","repos_url":"https://api.github.com/users/shane-tomlinson/repos","events_url":"https://api.github.com/users/shane-tomlinson/events{/privacy}","received_events_url":"https://api.github.com/users/shane-tomlinson/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mozilla/fxa-content-server/milestones/64","html_url":"https://github.com/mozilla/fxa-content-server/milestones/FxA-0:%20quality","labels_url":"https://api.github.com/repos/mozilla/fxa-content-server/milestones/64/labels","id":1265659,"number":64,"title":"FxA-0: quality","description":"An ongoing milestone into which we can schedule maintenance tasks, tech-debt paydown, and other code-quality-related issues.","creator":{"login":"rfk","id":34695,"avatar_url":"https://avatars.githubusercontent.com/u/34695?v=3","gravatar_id":"","url":"https://api.github.com/users/rfk","html_url":"https://github.com/rfk","followers_url":"https://api.github.com/users/rfk/followers","following_url":"https://api.github.com/users/rfk/following{/other_user}","gists_url":"https://api.github.com/users/rfk/gists{/gist_id}","starred_url":"https://api.github.com/users/rfk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfk/subscriptions","organizations_url":"https://api.github.com/users/rfk/orgs","repos_url":"https://api.github.com/users/rfk/repos","events_url":"https://api.github.com/users/rfk/events{/privacy}","received_events_url":"https://api.github.com/users/rfk/received_events","type":"User","site_admin":false},"open_issues":47,"closed_issues":129,"state":"open","created_at":"2015-08-21T02:49:53Z","updated_at":"2016-01-28T13:53:03Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413/commits","review_comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413/comments","review_comment_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/3413/comments","statuses_url":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/d9a50cf815c309452e3afbefc32a09a1a7b140ac","head":{"label":"mozilla:phil/issue-2778","ref":"phil/issue-2778","sha":"d9a50cf815c309452e3afbefc32a09a1a7b140ac","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":11778024,"name":"fxa-content-server","full_name":"mozilla/fxa-content-server","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/fxa-content-server","description":"Firefox Accounts Content Server","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-content-server","forks_url":"https://api.github.com/repos/mozilla/fxa-content-server/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-content-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-content-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-content-server/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-content-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-content-server/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-content-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-content-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-content-server/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-content-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-content-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-content-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-content-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-content-server/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-content-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-content-server/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-content-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-content-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-content-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-content-server/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-content-server/deployments","created_at":"2013-07-30T23:35:35Z","updated_at":"2016-01-12T18:54:47Z","pushed_at":"2016-01-28T18:00:20Z","git_url":"git://github.com/mozilla/fxa-content-server.git","ssh_url":"git@github.com:mozilla/fxa-content-server.git","clone_url":"https://github.com/mozilla/fxa-content-server.git","svn_url":"https://github.com/mozilla/fxa-content-server","homepage":"","size":14279,"stargazers_count":87,"watchers_count":87,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":136,"forks":55,"open_issues":136,"watchers":87,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"31ddbca5a70de064fd8ec7cfafb9fd37c758ca16","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":11778024,"name":"fxa-content-server","full_name":"mozilla/fxa-content-server","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/fxa-content-server","description":"Firefox Accounts Content Server","fork":false,"url":"https://api.github.com/repos/mozilla/fxa-content-server","forks_url":"https://api.github.com/repos/mozilla/fxa-content-server/forks","keys_url":"https://api.github.com/repos/mozilla/fxa-content-server/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/fxa-content-server/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/fxa-content-server/teams","hooks_url":"https://api.github.com/repos/mozilla/fxa-content-server/hooks","issue_events_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/fxa-content-server/events","assignees_url":"https://api.github.com/repos/mozilla/fxa-content-server/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/fxa-content-server/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/tags","blobs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/fxa-content-server/languages","stargazers_url":"https://api.github.com/repos/mozilla/fxa-content-server/stargazers","contributors_url":"https://api.github.com/repos/mozilla/fxa-content-server/contributors","subscribers_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscribers","subscription_url":"https://api.github.com/repos/mozilla/fxa-content-server/subscription","commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/fxa-content-server/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/fxa-content-server/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/fxa-content-server/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/fxa-content-server/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/fxa-content-server/merges","archive_url":"https://api.github.com/repos/mozilla/fxa-content-server/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/fxa-content-server/downloads","issues_url":"https://api.github.com/repos/mozilla/fxa-content-server/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/fxa-content-server/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/fxa-content-server/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/fxa-content-server/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/fxa-content-server/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/fxa-content-server/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/fxa-content-server/deployments","created_at":"2013-07-30T23:35:35Z","updated_at":"2016-01-12T18:54:47Z","pushed_at":"2016-01-28T18:00:20Z","git_url":"git://github.com/mozilla/fxa-content-server.git","ssh_url":"git@github.com:mozilla/fxa-content-server.git","clone_url":"https://github.com/mozilla/fxa-content-server.git","svn_url":"https://github.com/mozilla/fxa-content-server","homepage":"","size":14279,"stargazers_count":87,"watchers_count":87,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":136,"forks":55,"open_issues":136,"watchers":87,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413"},"html":{"href":"https://github.com/mozilla/fxa-content-server/pull/3413"},"issue":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/issues/3413"},"comments":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/issues/3413/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/pulls/3413/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/fxa-content-server/statuses/d9a50cf815c309452e3afbefc32a09a1a7b140ac"}}}}