diff --git a/lib/static/views.js b/lib/static/views.js index af0f9f7763b9bafa24a56cc56e53365995120981..923ade13326510f35b65cf10ec265d3269a49de7 100644 --- a/lib/static/views.js +++ b/lib/static/views.js @@ -145,10 +145,6 @@ exports.setup = function(app) { renderCachableView(req, res, 'index.ejs', {title: _('A Better Way to Sign In'), fullpage: true}); }); - app.get("/signup", function(req, res) { - renderCachableView(req, res, 'signup.ejs', {title: _('Sign Up'), fullpage: false}); - }); - app.get("/idp_auth_complete", function(req, res) { renderCachableView(req, res, 'idp_auth_complete.ejs', { title: _('Sign In Complete'), diff --git a/lib/static_resources.js b/lib/static_resources.js index 87575a1375eea7c4f0ab9aace005ce4f8df9f019..1a18455616ab66fb0aaa50ea38f73a4f540e1c94 100644 --- a/lib/static_resources.js +++ b/lib/static_resources.js @@ -70,7 +70,6 @@ var browserid_js = und.flatten([ '/pages/js/forgot.js', '/pages/js/manage_account.js', '/pages/js/signin.js', - '/pages/js/signup.js', '/pages/js/about.js' ] ]); diff --git a/resources/static/common/css/style.css b/resources/static/common/css/style.css index ab5a2a960f12cafd4b5d13115bbb83558ca2e6cb..cd2760e4c936f97ca0ec43ba652a8749064e4cf7 100644 --- a/resources/static/common/css/style.css +++ b/resources/static/common/css/style.css @@ -61,7 +61,9 @@ strong { } .hidden { + /* This funkiness is so that labels still appear for screen readers */ visibility: hidden; + display: block; height: 0; } @@ -139,6 +141,10 @@ input[type=password]:disabled { border-color: #b2b2b2; } +label { + display: block; +} + label + input[type=text], label + input[type=password], label + input[type=email] { diff --git a/resources/static/common/js/lib/dom-jquery.js b/resources/static/common/js/lib/dom-jquery.js index 0faeb1ccc0db906754e3461716bbfd2b8c3bd1dc..78ab5814c90045bf6e8077f1481d2fdb3e15cdc7 100644 --- a/resources/static/common/js/lib/dom-jquery.js +++ b/resources/static/common/js/lib/dom-jquery.js @@ -328,6 +328,46 @@ BrowserID.DOM = ( function() { */ hide: function( elementToHide ) { return jQuery( elementToHide ).hide(); + }, + + /** + * Slide an element down + * @method slideDown + * @param {selector || element} elementToSlide + * @param {number} [animationTime] + */ + slideDown: function( elementToSlide, animationTime ) { + return jQuery( elementToSlide ).slideDown( animationTime ); + }, + + /** + * Slide an element up + * @method slideUp + * @param {selector || element} elementToSlide + * @param {number} [animationTime] + */ + slideUp: function( elementToSlide, animationTime ) { + return jQuery( elementToSlide ).slideUp( animationTime ); + }, + + /** + * Fade an element in + * @method fadeIn + * @param {selector || element} elementToFade + * @param {number} [animationTime] + */ + fadeIn: function( elementToFade, animationTime ) { + return jQuery( elementToFade ).fadeIn( animationTime ); + }, + + /** + * Fade an element out + * @method fadeOut + * @param {selector || element} elementToFade + * @param {number} [animationTime] + */ + fadeOut: function( elementToFade, animationTime ) { + return jQuery( elementToFade ).fadeOut( animationTime ); } }; diff --git a/resources/static/dialog/css/style.css b/resources/static/dialog/css/style.css index 9543dd9dfe6f496631798773fcec0fde7058fcfe..73ac003f88f24409936312ae92b2204f1c7ac33c 100644 --- a/resources/static/dialog/css/style.css +++ b/resources/static/dialog/css/style.css @@ -104,7 +104,6 @@ footer { } label { - display: block; text-shadow: 1px 1px 0 rgba(255,255,255,0.5); } diff --git a/resources/static/pages/css/style.css b/resources/static/pages/css/style.css index e61db1ce54a67927c399cccdac536c6356087676..961776973320bb9e79ab4e30396bd891c54fd119 100644 --- a/resources/static/pages/css/style.css +++ b/resources/static/pages/css/style.css @@ -449,23 +449,35 @@ button.delete:active { } -#signUpForm ul { - margin: 0 0 20px; -} - #signUpForm li { - margin: 0 0 10px; + margin: 10px 0 0; padding: 0; } +#signUpForm li:first-child { + margin: 0; +} + #signUpForm > .siteinfo { margin-bottom: 10px; } -.siteinfo, #congrats, .password_entry, #verify_password, .enter_password .hint, #unknown_secondary, .verify_primary .forminputs { +.siteinfo, #congrats, .password_entry, .vpassword_entry, .verify_primary, .known_secondary .start, .unknown_secondary .start, .primary .start, .unknown_secondary .forgot { display: none; } +.enter_password .password_entry { + display: block; +} + +label.vpassword_entry { + margin-top: 15px; +} + +.submit { + margin-top: 15px; +} + .submit > p { line-height: 28px; } @@ -476,11 +488,7 @@ button.delete:active { .tospp { font-size: 13px; -} - -.enter_password .password_entry, .enter_verify_password #verify_password, .known_secondary .password_entry, -.unknown_secondary #unknown_secondary, .verify_primary #verify_primary { - display: block; + clear: both; } #congrats .siteinfo { diff --git a/resources/static/pages/js/forgot.js b/resources/static/pages/js/forgot.js index 4d59778a1d04abdd9fff0dd41d580b15f208a985..c8e2da96d4d6d6fb2f4939c3b5bb42852dbffee2 100644 --- a/resources/static/pages/js/forgot.js +++ b/resources/static/pages/js/forgot.js @@ -28,7 +28,7 @@ BrowserID.forgot = (function() { if (email && validPass) { user.requestPasswordReset(email, pass, function onSuccess(info) { if (info.success) { - pageHelpers.emailSent("waitForPasswordResetComplete", oncomplete); + pageHelpers.emailSent("waitForPasswordResetComplete", email, oncomplete); } else { var tooltipEl = info.reason === "throttle" ? "#could_not_add" : "#not_registered"; diff --git a/resources/static/pages/js/page_helpers.js b/resources/static/pages/js/page_helpers.js index c43ed717f48fe3b7bdb6ac107a81b6a0c565429b..8147bcfead2b39a1ede20bc48d98ec16af6e07fd 100644 --- a/resources/static/pages/js/page_helpers.js +++ b/resources/static/pages/js/page_helpers.js @@ -88,15 +88,13 @@ BrowserID.PageHelpers = (function() { .promise().done(onComplete); } - function emailSent(pollFuncName, onComplete) { - origStoredEmail = getStoredEmail(); - dom.setInner('#sentToEmail', origStoredEmail); - - clearStoredEmail(); + function emailSent(pollFuncName, email, onComplete) { + dom.setInner('#sentToEmail', email); replaceInputsWithNotice(".emailsent"); - user[pollFuncName](origStoredEmail, function(status) { + user[pollFuncName](email, function(status) { + clearStoredEmail(); userValidationComplete(status); }); onComplete && onComplete(); @@ -113,8 +111,6 @@ BrowserID.PageHelpers = (function() { } function cancelEmailSent(onComplete) { - setStoredEmail(origStoredEmail); - showInputs(onComplete); user.cancelEmailValidation(); diff --git a/resources/static/pages/js/signin.js b/resources/static/pages/js/signin.js index edc58501195871df8b021adfdcd325f87ba6357d..1ee76851808cd3d19839e83e148b60b1ba8378b4 100644 --- a/resources/static/pages/js/signin.js +++ b/resources/static/pages/js/signin.js @@ -1,4 +1,4 @@ -/*globals BrowserID:true, $:true*/ +/*globals BrowserID:true, gettext:true */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -14,16 +14,19 @@ BrowserID.signIn = (function() { errors = bid.Errors, pageHelpers = bid.PageHelpers, tooltip = bid.Tooltip, + validation = bid.Validation, doc = document, winchan = window.WinChan, + complete = helpers.complete, verifyEmail, verifyURL, addressInfo, sc, lastEmail; - function complete(oncomplete, status) { - oncomplete && oncomplete(status); + function userAuthenticated() { + pageHelpers.clearStoredEmail(); + doc.location = "/"; } function provisionPrimaryUser(email, info, callback) { @@ -31,39 +34,49 @@ BrowserID.signIn = (function() { user.provisionPrimaryUser(email, info, function(status, provInfo) { if (status === "primary.verified") { network.authenticateWithAssertion(email, provInfo.assertion, function(status) { - doc.location = "/"; - + userAuthenticated(); complete(callback); }, pageHelpers.getFailure(errors.authenticateWithAssertion, callback)); } else { - $("#primary_no_login").fadeIn(250); + dom.fadeIn("#primary_no_login", 250); setTimeout(complete.curry(callback), 250); } }, pageHelpers.getFailure(errors.provisioningPrimary, callback)); } function emailSubmit(oncomplete) { + /*jshint validthis: true*/ var self=this, email = helpers.getAndValidateEmail("#email"); - if(email) { + if (email) { dom.setAttr('#email', 'disabled', 'disabled'); user.addressInfo(email, function(info) { dom.removeAttr('#email', 'disabled'); addressInfo = info; - if(info.type === "secondary") { - if(info.known) { - dom.addClass("body", "known_secondary"); - dom.focus("#password"); - self.submit = passwordSubmit; - } - else { - dom.setInner("#unknown_email", email); - dom.addClass("body", "unknown_secondary"); + if (info.type === "secondary") { + // A secondary user has to either sign in or sign up depending on the + // status of their email address. + var bodyClassName = "known_secondary", + showClassName = "password_entry", + title = gettext("Sign In"), + submit = signInSubmit; + + if (!info.known) { + bodyClassName = "unknown_secondary"; + showClassName = "vpassword_entry"; + title = gettext("Sign Up"), + submit = signUpSubmit; } + dom.addClass("body", bodyClassName); + dom.slideDown("." + showClassName); + dom.setInner("#title", title); + self.submit = submit; + dom.focus("#password"); + complete(oncomplete); } else if(info.authed) { @@ -72,7 +85,10 @@ BrowserID.signIn = (function() { provisionPrimaryUser(email, info, oncomplete); } else { - dom.addClass("body", "verify_primary"); + // primary user who is not authenticated with primary, must auth with + // primary and then authenticate them to BrowserID. + dom.addClass("body", "primary"); + dom.slideDown(".verify_primary"); dom.setInner("#primary_email", email); self.submit = authWithPrimary; @@ -88,18 +104,16 @@ BrowserID.signIn = (function() { } } - function passwordSubmit(oncomplete) { + function signInSubmit(oncomplete) { var email = helpers.getAndValidateEmail("#email"), password = helpers.getAndValidatePassword("#password"); if (email && password) { - user.authenticate(email, password, function onSuccess(authenticated) { + user.authenticate(email, password, function(authenticated) { if (authenticated) { - pageHelpers.clearStoredEmail(); - doc.location = "/"; + userAuthenticated(); } else { - // bad authentication tooltip.showTooltip("#cannot_authenticate"); } complete(oncomplete); @@ -110,6 +124,33 @@ BrowserID.signIn = (function() { } } + function signUpSubmit(oncomplete) { + /*jshint validthis: true*/ + var email = dom.getInner("#email"), + pass = dom.getInner("#password"), + vpass = dom.getInner("#vpassword"), + valid = validation.passwordAndValidationPassword(pass, vpass); + + if(email && valid) { + user.createSecondaryUser(email, pass, function(status) { + if(status.success) { + // clearing the stored email from localStorage is taken care + // of in emailSent. + pageHelpers.emailSent("waitForUserValidation", email, + complete.curry(oncomplete, true)); + } + else { + tooltip.showTooltip("#could_not_add"); + complete(oncomplete, false); + } + }, pageHelpers.getFailure(errors.createUser, oncomplete)); + } + else { + complete(oncomplete, false); + } + } + + function authWithPrimary(oncomplete) { pageHelpers.openPrimaryAuth(winchan, verifyEmail, verifyURL, primaryAuthComplete); @@ -126,12 +167,15 @@ BrowserID.signIn = (function() { } function onEmailChange(event) { + /*jshint validthis: true*/ + // this is basically a state reset. var email = dom.getInner("#email"); if(email !== lastEmail) { - dom.removeClass("body", "verify_primary"); + dom.removeClass("body", "primary"); dom.removeClass("body", "known_secondary"); dom.removeClass("body", "unknown_secondary"); + dom.slideUp(".password_entry, .vpassword_entry, .verify_primary"); this.submit = emailSubmit; lastEmail = email; } @@ -151,13 +195,24 @@ BrowserID.signIn = (function() { self.bind("#email", "keyup", onEmailChange); sc.start.call(self, options); + + // If there is an email already set up in pageHelpers.setupEmail, see if + // the email address is a primary, secondary, known or unknown. Redirect + // if needed. + if (dom.getInner("#email")) { + self.submit(options.ready); + } + else { + complete(options.ready); + } }, submit: emailSubmit // BEGIN TESTING API , emailSubmit: emailSubmit, - passwordSubmit: passwordSubmit, + signInSubmit: signInSubmit, + signUpSubmit: signUpSubmit, authWithPrimary: authWithPrimary, primaryAuthComplete: primaryAuthComplete // END TESTING API diff --git a/resources/static/pages/js/signup.js b/resources/static/pages/js/signup.js deleted file mode 100644 index 1284ebf88418cac8dff4d94fbeeb705a0830f7c4..0000000000000000000000000000000000000000 --- a/resources/static/pages/js/signup.js +++ /dev/null @@ -1,178 +0,0 @@ -/*globals BrowserID:true, $:true*/ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -BrowserID.signUp = (function() { - "use strict"; - - var bid = BrowserID, - user = bid.User, - dom = bid.DOM, - helpers = bid.Helpers, - pageHelpers = bid.PageHelpers, - cancelEvent = pageHelpers.cancelEvent, - validation = bid.Validation, - errors = bid.Errors, - tooltip = BrowserID.Tooltip, - ANIMATION_SPEED = 250, - storedEmail = pageHelpers, - winchan = window.WinChan, - primaryUserInfo, - sc; - - function showNotice(selector) { - $(selector).fadeIn(ANIMATION_SPEED); - } - - function authWithPrimary(oncomplete) { - pageHelpers.openPrimaryAuth(winchan, primaryUserInfo.email, primaryUserInfo.auth, primaryAuthComplete); - - oncomplete && oncomplete(); - } - - function primaryAuthComplete(error, result, oncomplete) { - if (error) { - pageHelpers.showFailure(errors.primaryAuthentication, error, oncomplete); - } - else { - // hey ho, the user is authenticated, re-try the submit. - createPrimaryUser(primaryUserInfo, oncomplete); - } - } - - function createPrimaryUser(info, oncomplete) { - function complete(status) { - oncomplete && oncomplete(status); - } - - user.createPrimaryUser(info, function onComplete(status, info) { - switch(status) { - case "primary.verified": - pageHelpers.replaceFormWithNotice("#congrats", complete.bind(null, true)); - break; - case "primary.verify": - primaryUserInfo = info; - dom.setInner("#primary_email", info.email); - pageHelpers.replaceInputsWithNotice("#primary_verify", complete.bind(null, false)); - break; - case "primary.could_not_add": - // XXX Can this happen? - break; - default: - break; - } - }, pageHelpers.getFailure(errors.createUser, complete)); - } - - function enterPasswordState(info) { - var self=this; - self.emailToStage = info.email; - self.submit = passwordSubmit; - - dom.addClass("body", "enter_password"); - } - - function passwordSubmit(oncomplete) { - var pass = dom.getInner("#password"), - vpass = dom.getInner("#vpassword"), - valid = validation.passwordAndValidationPassword(pass, vpass); - - if(valid) { - user.createSecondaryUser(this.emailToStage, pass, function(status) { - if(status.success) { - pageHelpers.emailSent("waitForUserValidation", oncomplete && oncomplete.curry(true)); - } - else { - tooltip.showTooltip("#could_not_add"); - oncomplete && oncomplete(false); - } - }, pageHelpers.getFailure(errors.createUser, oncomplete)); - } - else { - oncomplete && oncomplete(false); - } - } - - function emailSubmit(oncomplete) { - var email = helpers.getAndValidateEmail("#email"), - self = this; - - if (email) { - dom.setAttr('#email', 'disabled', 'disabled'); - user.isEmailRegistered(email, function(isRegistered) { - if(isRegistered) { - dom.removeAttr('#email', 'disabled'); - $('#registeredEmail').html(email); - showNotice(".alreadyRegistered"); - oncomplete && oncomplete(false); - } - else { - user.addressInfo(email, function(info) { - dom.removeAttr('#email', 'disabled'); - if(info.type === "primary") { - createPrimaryUser.call(self, info, oncomplete); - } - else { - enterPasswordState.call(self, info); - oncomplete && oncomplete(!isRegistered); - } - }, pageHelpers.getFailure(errors.addressInfo, oncomplete)); - } - }, pageHelpers.getFailure(errors.isEmailRegistered, oncomplete)); - } - else { - oncomplete && oncomplete(false); - } - } - - function back(oncomplete) { - pageHelpers.cancelEmailSent(oncomplete); - } - - function onEmailKeyUp(event) { - if (event.which !== 13) $(".notification").fadeOut(ANIMATION_SPEED); - } - - var Module = bid.Modules.PageModule.extend({ - start: function(options) { - var self=this; - options = options || {}; - - if (options.winchan) { - winchan = options.winchan; - } - - dom.focus("form input[autofocus]"); - - pageHelpers.setupEmail(); - - self.bind("#email", "keyup", onEmailKeyUp); - self.click("#back", back); - self.click("#authWithPrimary", authWithPrimary); - - sc.start.call(self, options); - }, - - submit: emailSubmit, - // BEGIN TESTING API - emailSubmit: emailSubmit, - passwordSubmit: passwordSubmit, - reset: reset, - back: back, - authWithPrimary: authWithPrimary, - primaryAuthComplete: primaryAuthComplete - // END TESTING API - }); - - - // BEGIN TESTING API - function reset() { - winchan = window.WinChan; - } - // END TESTING API - - sc = Module.sc; - - return Module; -}()); diff --git a/resources/static/pages/js/start.js b/resources/static/pages/js/start.js index 4fa4b83a5e1115f391df2ff709e9e967947edfad..740b1f0bd3e0692a64b529430697ab004b92ebab 100644 --- a/resources/static/pages/js/start.js +++ b/resources/static/pages/js/start.js @@ -138,10 +138,6 @@ $(function() { var module = bid.signIn.create(); module.start({}); } - else if (path === "/signup") { - var module = bid.signUp.create(); - module.start({}); - } else if (path === "/forgot") { bid.forgot(); } diff --git a/resources/static/test/cases/pages/js/page_helpers.js b/resources/static/test/cases/pages/js/page_helpers.js index b389cbc506b61e717324c33c7a5f6812b16b2f20..822e3a1d621b9e02a69e0365b3ba0d9aa8c9409e 100644 --- a/resources/static/test/cases/pages/js/page_helpers.js +++ b/resources/static/test/cases/pages/js/page_helpers.js @@ -9,6 +9,8 @@ var bid = BrowserID, pageHelpers = bid.PageHelpers, testHelpers = bid.TestHelpers, + testVisible = testHelpers.testVisible, + testNotVisible = testHelpers.testNotVisible, user = bid.User, WindowMock = bid.Mocks.WindowMock, winMock, @@ -20,7 +22,7 @@ testHelpers.setup(); winMock = new WindowMock(); pageHelpers.init({ window: winMock }); - bid.Renderer.render("#page_head", "site/signup", {}); + bid.Renderer.render("#page_head", "site/signin", {}); $(".siteinfo,.emailsent").hide(); }, @@ -66,17 +68,18 @@ }); asyncTest("replaceFormWithNotice replaces contents", function() { + bid.Renderer.render("#page_head", "site/verify_email_address", {}); pageHelpers.replaceFormWithNotice("#congrats", function() { - equal($("form").is(":visible"), false, "form has been hidden"); - equal($("#congrats").is(":visible"), true, "congrats is now visible"); + testNotVisible("form"); + testVisible("#congrats"); start(); }); }); asyncTest("replaceInputsWithNotice replaces contents", function() { pageHelpers.replaceInputsWithNotice(".emailsent", function() { - equal($(".emailsent").is(":visible"), true, "emailsent is visible"); - equal($(".forminputs").is(":visible"), false, "inputs are hidden"); + testVisible(".emailsent"); + testNotVisible(".forminputs"); start(); }); }); @@ -84,8 +87,8 @@ asyncTest("showInputs hides notices and shows the inputs", function() { pageHelpers.replaceInputsWithNotice(".emailsent", function() { pageHelpers.showInputs(function() { - equal($(".emailsent").is(":visible"), false, "emailsent is hidden"); - equal($(".forminputs").is(":visible"), true, "inputs are shown"); + testNotVisible(".emailsent"); + testVisible(".forminputs"); start(); }); }); @@ -93,16 +96,14 @@ asyncTest("emailSent shows correct email sent message, starts waiting for user validation", function() { - pageHelpers.setStoredEmail("registered@testuser.com"); - // set the result to complete to immediately return. We'll test each case // below. xhr.useResult("complete"); - pageHelpers.emailSent("waitForUserValidation", function() { + pageHelpers.emailSent("waitForUserValidation", "registered@testuser.com", function() { equal($("#sentToEmail").html(), "registered@testuser.com", "correct email is set"); - equal($(".emailsent").is(":visible"), true, "emailsent is visible"); - equal($(".forminputs").is(":visible"), false, "inputs are hidden"); + testVisible(".emailsent"); + testNotVisible(".forminputs"); start(); }); @@ -132,16 +133,12 @@ equal(winMock.document.location.href, "/", "with complete status, redirect to /"); }); - asyncTest("cancelEmailSent restores the stored email, inputs are shown again", function() { - pageHelpers.setStoredEmail("registered@testuser.com"); + asyncTest("cancelEmailSent - inputs are shown again", function() { xhr.useResult("complete"); - pageHelpers.emailSent("waitForUserValidation", function() { + pageHelpers.emailSent("waitForUserValidation", "registered@testuser.com", function() { pageHelpers.cancelEmailSent(function() { - var email = pageHelpers.getStoredEmail(); - equal(email, "registered@testuser.com", "stored email is reset on cancel"); - equal($(".emailsent").is(":visible"), false, "emailsent is not visible"); - equal($(".forminputs").is(":visible"), true, "inputs are visible"); - // equal($("#email").is(":focus"), true, "first element is focused (NOTE: requires your browser to be focused to work)"); + testNotVisible(".emailsent"); + testVisible(".forminputs"); start(); }); }); @@ -159,7 +156,7 @@ // Add a bit of delay to wait for the animation setTimeout(function() { - equal($("#error .moreInfo").is(":visible"), true, "extra info is visible after click"); + testVisible("#error .moreInfo", "extra info is visible after click"); start(); }, 100); diff --git a/resources/static/test/cases/pages/js/signin.js b/resources/static/test/cases/pages/js/signin.js index 9e07840d19773eae0b45a1f60d9000badb9b43a6..46998f13b2cdf36b4210ecb16b8d361e9969a005 100644 --- a/resources/static/test/cases/pages/js/signin.js +++ b/resources/static/test/cases/pages/js/signin.js @@ -12,36 +12,116 @@ xhr = bid.Mocks.xhr, WinChanMock = bid.Mocks.WinChan, provisioning = bid.Mocks.Provisioning, + WindowMock = bid.Mocks.WindowMock, testHelpers = bid.TestHelpers, - docMock = { - location: "signin" - }, + testDocumentRedirected = testHelpers.testDocumentRedirected, + testDocumentNotRedirected = testHelpers.testDocumentNotRedirected, + testHasClass = testHelpers.testHasClass, + pageHelpers = bid.PageHelpers, + docMock, controller, winchan; + function createController(options) { + winchan = new WinChanMock(); + + var winMock = new WindowMock(); + docMock = winMock.document; + + pageHelpers.init({ + win: winMock + }); + + options = options || {}; + _.extend(options, { + document: docMock, + winchan: winchan + }); + + controller = bid.signIn.create(); + controller.start(options); + } + module("pages/js/signin", { setup: function() { testHelpers.setup(); - docMock.location = "signin"; bid.Renderer.render("#page_head", "site/signin", {}); - winchan = new WinChanMock(); - controller = bid.signIn.create(); - controller.start({document: docMock, winchan: winchan}); + createController(); }, teardown: function() { testHelpers.teardown(); + pageHelpers.reset(); if(controller) controller.destroy(); } }); function testUserNotSignedIn(extraTests) { - controller.passwordSubmit(function() { - equal(docMock.location, "signin", "user not signed in"); + controller.signInSubmit(function() { + testDocumentNotRedirected(docMock, "user not signed in"); if (extraTests) extraTests(); start(); }); } + function testUserNotSignedUp(extraTests) { + controller.signUpSubmit(function() { + testDocumentNotRedirected(docMock, "user not signed up"); + if (extraTests) extraTests(); + start(); + }); + } + + asyncTest("start with no email stored - nothing fancy", function() { + createController({ + ready: function() { + testDocumentNotRedirected(docMock, "user not signed in"); + start(); + } + }); + }); + + asyncTest("start with unknown secondary email stored - show double password", function() { + xhr.useResult("unknown_secondary"); + pageHelpers.setStoredEmail("unregistered@testuser.com"); + createController({ + ready: function() { + testHasClass("body", "unknown_secondary", "unknown_secondary class added to body"); + testDocumentNotRedirected(docMock); + equal($("#title").html(), "Sign Up", "title correctly set"); + start(); + } + }); + }); + + asyncTest("start with known secondary email stored - show password", function() { + xhr.useResult("known_secondary"); + pageHelpers.setStoredEmail("registered@testuser.com"); + createController({ + ready: function() { + testHasClass("body", "known_secondary", "known_secondary class added to body"); + testDocumentNotRedirected(docMock); + equal($("#title").html(), "Sign In", "title correctly set"); + + start(); + } + }); + }); + + asyncTest("start with known primary email stored - show verify primary", function() { + xhr.useResult("primary"); + provisioning.setStatus(provisioning.NOT_AUTHENTICATED); + pageHelpers.setStoredEmail("registered@testuser.com"); + + createController({ + ready: function() { + testHasClass("body", "primary", "primary class added to body"); + + testDocumentNotRedirected(docMock); + start(); + } + }); + }); + asyncTest("emailSubmit with invalid email - show tooltip", function() { controller.emailSubmit(function() { testHelpers.testTooltipVisible(); @@ -59,13 +139,13 @@ }); }); - asyncTest("unknown_secondary: emailSubmit - add unknown_secondary to body", function() { + asyncTest("unknown_secondary: emailSubmit - unknown_secondary added to body", function() { xhr.useResult("unknown_secondary"); $("#email").val("unregistered@testuser.com"); controller.emailSubmit(function() { - equal($("body").hasClass("unknown_secondary"), true, "unknown_secondary class added to body"); - equal(controller.submit, controller.emailSubmit, "submit remains emailSubmit"); + testHasClass("body", "unknown_secondary", "unknown_secondary class added to body"); + equal(controller.submit, controller.signUpSubmit, "submit has changed to signUpSubmit"); start(); }); }); @@ -75,8 +155,8 @@ $("#email").val("registered@testuser.com"); controller.emailSubmit(function() { - equal($("body").hasClass("known_secondary"), true, "known_secondary class added to body"); - equal(controller.submit, controller.passwordSubmit, "submit has changed to passwordSubmit"); + testHasClass("body", "known_secondary", "known_secondary class added to body"); + equal(controller.submit, controller.signInSubmit, "submit has changed to signInSubmit"); start(); }); }); @@ -101,40 +181,40 @@ $("#email").val("registered@testuser.com"); controller.emailSubmit(function() { - equal($("body").hasClass("verify_primary"), true, "verify_primary class added to body"); + testHasClass("body", "primary", "primary class added to body"); equal(controller.submit, controller.authWithPrimary, "submit updated to authWithPrimary"); start(); }); }); - asyncTest("passwordSubmit with valid email and password", function() { + asyncTest("signInSubmit with valid email and password", function() { $("#email").val("registered@testuser.com"); $("#password").val("password"); - controller.passwordSubmit(function() { + controller.signInSubmit(function() { equal(docMock.location, "/", "user signed in, page redirected"); start(); }); }); - asyncTest("passwordSubmit with valid email with leading/trailing whitespace and password", function() { + asyncTest("signInSubmit with valid email with leading/trailing whitespace and password", function() { $("#email").val(" registered@testuser.com "); $("#password").val("password"); - controller.passwordSubmit(function() { + controller.signInSubmit(function() { equal(docMock.location, "/", "user signed in, page redirected"); start(); }); }); - asyncTest("passwordSubmit with missing email", function() { + asyncTest("signInSubmit with missing email", function() { $("#email").val(""); $("#password").val("password"); testUserNotSignedIn(); }); - asyncTest("passwordSubmit with missing password", function() { + asyncTest("signInSubmit with missing password", function() { $("#email").val("registered@testuser.com"); $("#password").val(""); @@ -142,7 +222,7 @@ }); - asyncTest("passwordSubmit with bad username/password", function() { + asyncTest("signInSubmit with bad username/password", function() { xhr.useResult("invalid"); $("#email").val("registered@testuser.com"); $("#password").val("password"); @@ -150,7 +230,7 @@ testUserNotSignedIn(); }); - asyncTest("passwordSubmit with XHR error", function() { + asyncTest("signInSubmit with XHR error", function() { xhr.useResult("ajaxError"); $("#email").val("registered@testuser.com"); $("#password").val("password"); @@ -158,6 +238,97 @@ testUserNotSignedIn(testHelpers.testErrorVisible); }); + + asyncTest("signUpSubmit with valid email and password", function() { + $("#email").val("registered@testuser.com"); + $("#password, #vpassword").val("password"); + + controller.signUpSubmit(function(status) { + ok(status, "signUpSubmit success"); + start(); + }); + }); + + asyncTest("signUpSubmit with valid email with leading/trailing whitespace and password", function() { + $("#email").val(" registered@testuser.com "); + $("#password, #vpassword").val("password"); + + controller.signUpSubmit(function(status) { + ok(status, "signUpSubmit success"); + start(); + }); + }); + + asyncTest("signUpSubmit with missing email", function() { + $("#email").val(""); + $("#password, #vpassword").val("password"); + + testUserNotSignedUp(); + }); + + asyncTest("signUpSubmit with missing password", function() { + $("#email").val("registered@testuser.com"); + $("#password").val(""); + $("#vpassword").val("password"); + + testUserNotSignedUp(); + }); + + asyncTest("signUpSubmit with missing vpassword", function() { + $("#email").val("registered@testuser.com"); + $("#password").val("password"); + $("#vpassword").val(""); + + testUserNotSignedUp(); + }); + + asyncTest("signUpSubmit with too short of a password", function() { + $("#email").val("registered@testuser.com"); + var pass = testHelpers.generateString(bid.PASSWORD_MIN_LENGTH - 1); + $("#password").val(pass); + $("#vpassword").val(pass); + + testUserNotSignedUp(); + }); + + asyncTest("signUpSubmit with too long of a password", function() { + $("#email").val("registered@testuser.com"); + var pass = testHelpers.generateString(bid.PASSWORD_MAX_LENGTH + 1); + $("#password").val(pass); + $("#vpassword").val(pass); + + testUserNotSignedUp(); + }); + + asyncTest("signUpSubmit with bad username/password", function() { + xhr.useResult("invalid"); + $("#email").val("registered@testuser.com"); + $("#password, #vpassword").val("password"); + + testUserNotSignedUp(); + }); + + asyncTest("signUpSubmit with throttling", function() { + $("#email").val("unregistered@testuser.com"); + $("#password, #vpassword").val("password"); + + xhr.useResult("throttle"); + controller.signUpSubmit(function(userStaged) { + equal(userStaged, false, "email throttling took effect, user not staged"); + start(); + }); + }); + + asyncTest("signUpSubmit with XHR error", function() { + xhr.useResult("ajaxError"); + $("#email").val("registered@testuser.com"); + $("#password,#vpassword").val("password"); + + testUserNotSignedUp(testHelpers.testErrorVisible); + }); + + + asyncTest("authWithPrimary opens winchan", function() { xhr.useResult("primary"); $("#email").val("unregistered@testuser.com"); diff --git a/resources/static/test/cases/pages/js/signup.js b/resources/static/test/cases/pages/js/signup.js deleted file mode 100644 index 736e1a3b636b7166812c39f8af524fe3f3164b44..0000000000000000000000000000000000000000 --- a/resources/static/test/cases/pages/js/signup.js +++ /dev/null @@ -1,200 +0,0 @@ -/*jshint browser: true, forin: true, laxbreak: true */ -/*global test: true, start: true, module: true, ok: true, equal: true, BrowserID:true */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -(function() { - "use strict"; - - var bid = BrowserID, - user = bid.User, - network = bid.Network, - xhr = bid.Mocks.xhr, - WinChanMock = bid.Mocks.WinChan, - testHelpers = bid.TestHelpers, - provisioning = bid.Mocks.Provisioning, - winchan, - controller; - - module("pages/js/signup", { - setup: function() { - testHelpers.setup(); - bid.Renderer.render("#page_head", "site/signup", {}); - $(".emailsent").hide(); - $(".notification").hide() - winchan = new WinChanMock(); - controller = bid.signUp.create(); - controller.start({ - winchan: winchan - }); - }, - teardown: function() { - testHelpers.teardown(); - controller.reset(); - controller.destroy(); - } - }); - - function testPasswordNotShown(extraTests) { - controller.submit(function(status) { - strictEqual(status, false, "address was not registered"); - equal($(".emailsent").is(":visible"), false, "email not sent, notice not visible"); - - if(extraTests) extraTests(); - start(); - }); - } - - asyncTest("signup with valid unregistered secondary email - show password", function() { - $("#email").val("unregistered@testuser.com"); - - controller.submit(function() { - equal($("body").hasClass("enter_password"), true, "new email, password section shown"); - - start(); - }); - }); - - - asyncTest("submit with valid unregistered email with leading/trailing whitespace", function() { - $("#email").val(" unregistered@testuser.com "); - - controller.submit(function() { - equal($("body").hasClass("enter_password"), true, "new email, password section shown"); - start(); - }); - }); - - asyncTest("submit with valid registered email", function() { - $("#email").val("registered@testuser.com"); - - testPasswordNotShown(); - }); - - asyncTest("submit with invalid email address", function() { - $("#email").val("invalid"); - - testPasswordNotShown(); - }); - - asyncTest("submit with XHR error", function() { - xhr.useResult("ajaxError"); - $("#email").val("unregistered@testuser.com"); - - testPasswordNotShown(function() { - testHelpers.testErrorVisible(); - }); - }); - - - asyncTest("passwordSubmit with throttling", function() { - $("#email").val("unregistered@testuser.com"); - $("#password, #vpassword").val("password"); - - xhr.useResult("throttle"); - controller.passwordSubmit(function(userStaged) { - equal(userStaged, false, "email throttling took effect, user not staged"); - start(); - }); - }); - - asyncTest("passwordSubmit happy case, check back button too", function() { - $("#email").val("unregistered@testuser.com"); - $("#password, #vpassword").val("password"); - - controller.passwordSubmit(function(userStaged) { - equal(userStaged, true, "user has been staged"); - equal($(".emailsent").is(":visible"), true, "email sent, notice visible"); - - // check back button - controller.back(function() { - equal($(".notification:visible").length, 0, "no notifications are visible - visible: " + $(".notification:visible").attr("id")); - ok($(".forminputs:visible").length, "form inputs are again visible"); - equal($("#email").val(), "unregistered@testuser.com", "email address restored"); - start(); - }); - }); - }); - - - asyncTest("signup with primary email address, provisioning failure - expect error screen", function() { - xhr.useResult("primary"); - $("#email").val("unregistered@testuser.com"); - provisioning.setFailure({ - code: "internal", - msg: "doowap" - }); - - controller.submit(function(status) { - equal(status, false, "provisioning failure, status false"); - testHelpers.testErrorVisible(); - start(); - }); - }); - - asyncTest("signup with primary email address, user verified by primary - print success message", function() { - xhr.useResult("primary"); - $("#email").val("unregistered@testuser.com"); - provisioning.setStatus(provisioning.AUTHENTICATED); - - controller.submit(function(status) { - equal(status, true, "primary addition success - true status"); - equal($("#congrats:visible").length, 1, "success notification is visible"); - start(); - }); - }); - - asyncTest("signup with primary email address, user must verify with primary", function() { - xhr.useResult("primary"); - $("#email").val("unregistered@testuser.com"); - - controller.submit(function(status) { - equal($("#primary_verify:visible").length, 1, "success notification is visible"); - equal($("#primary_email").text(), "unregistered@testuser.com", "correct email shown"); - equal(status, false, "user must authenticate, some action needed."); - start(); - }); - }); - - asyncTest("authWithPrimary opens new tab", function() { - xhr.useResult("primary"); - $("#email").val("unregistered@testuser.com"); - - controller.submit(function(status) { - controller.authWithPrimary(function() { - ok(winchan.oncomplete, "winchan set up"); - start(); - }); - }); - }); - - asyncTest("primaryAuthComplete with error, expect incorrect status", function() { - controller.primaryAuthComplete("error", "", function(status) { - equal(status, false, "correct status for could not complete"); - testHelpers.testErrorVisible(); - start(); - }); - }); - - asyncTest("primaryAuthComplete with successful authentication, expect correct status and congrats message", function() { - xhr.useResult("primary"); - $("#email").val("unregistered@testuser.com"); - - controller.submit(function(status) { - controller.authWithPrimary(function() { - // In real life the user would now be authenticated. - provisioning.setStatus(provisioning.AUTHENTICATED); - - // Before primaryAuthComplete is called, we reset the user caches to - // force re-fetching of what could have been stale user data. - user.resetCaches(); - controller.primaryAuthComplete(null, "success", function(status) { - equal(status, true, "correct status"); - equal($("#congrats:visible").length, 1, "success notification is visible"); - start(); - }); - }); - }); - }); - -}()); diff --git a/resources/static/test/testHelpers/helpers.js b/resources/static/test/testHelpers/helpers.js index ce7ee117468a1af34dfd8827c6adc60f611d12f3..8053729f5cc6a7ac726a055f218a285bcb2b55eb 100644 --- a/resources/static/test/testHelpers/helpers.js +++ b/resources/static/test/testHelpers/helpers.js @@ -264,7 +264,11 @@ BrowserID.TestHelpers = (function() { }, testVisible: function(selector, msg) { - ok($(selector).is(":visible"), msg || selector + " should be visible"); + ok($(selector).is(":visible"), msg || selector + " is visible"); + }, + + testNotVisible: function(selector, msg) { + equal($(selector).is(":visible"), false, msg || selector + " is not visible"); }, testHasClass: function(selector, className, msg) { @@ -330,6 +334,15 @@ BrowserID.TestHelpers = (function() { var emailInfo = storage.getEmail(email); equal(emailInfo && emailInfo.verified, true, "verified bit set for " + email); + }, + + testDocumentRedirected: function(doc, expectedHref, msg) { + equal(doc.location, expectedHref, msg || "document redirected to " + expectedHref); + }, + + testDocumentNotRedirected: function(doc, msg) { + equal(doc.location.href, document.location.href, msg || "document not redirected"); + } }; diff --git a/resources/views/index.ejs b/resources/views/index.ejs index c1dcdf8c9756576bce2888d6d71b0a06543ff563..77c2b4af563974f63d7e8a87db4f56f03e9e4a4a 100644 --- a/resources/views/index.ejs +++ b/resources/views/index.ejs @@ -12,7 +12,7 @@ <%- format(gettext('<a %(aboutLink)>Take the tour</a> or <a %(signupButton)>Sign Up →</a>'), { aboutLink: 'href="/about"', - signupButton: 'href="/signup" class="button create"', + signupButton: 'href="/signin" class="button create"', }) %> </p> </div> diff --git a/resources/views/signin.ejs b/resources/views/signin.ejs index 38cb227c5771ced3ecbf1dec6fdbbaef7390cff1..a255e7df4922e64885f358d927fde0615ac8533b 100644 --- a/resources/views/signin.ejs +++ b/resources/views/signin.ejs @@ -6,20 +6,26 @@ <div id="vAlign"> <!-- XXX this form submits to nowhere --> <form id="signUpForm" class="cf authform" novalidate> - <h1><%- gettext('Sign In') %></h1> + <h1 id="title"><%- gettext('Sign In') %></h1> <ul class="notifications"> - <li class="notification" id="unknown_secondary"> - <%- format(gettext('<strong %(emailId)>Email</strong> is not registered. Would you like to <a %(signUpLink)>sign up</a> instead?'), - { emailId: 'id="unknown_email"', signUpLink: 'class="action" href="/signup"' }) %> - </li> + <li class="notification emailsent"> + <h2><%- gettext('Confirm your email address') %></h2> + + <p> + <%- format(gettext('Check your email at <strong %(emailId)></strong>.'), { emailId: 'id="sentToEmail"' }) %> + </p> + <p> + <%- gettext('Click the link in the confirmation email. You\'ll then immediately be signed into Persona.') %> + </p> + </li> </ul> - <ul class="inputs"> + <ul class="inputs forminputs"> <li> - <label for="email"><%- gettext('Email Address') %></label> - <input id="email" autofocus placeholder="<%- gettext('Your Email') %>" type="email" autocapitalize="off" autocorrect="off" spellcheck="false" tabindex="1" maxlength="254" /> + <label for="email"><%- gettext('To sign in with Persona, please enter your email address.') %></label> + <input id="email" autofocus placeholder="<%- gettext('enter email address') %>" type="email" autocapitalize="off" autocorrect="off" spellcheck="false" maxlength="254" /> <div id="email_format" class="tooltip" for="email"> <%- gettext('This field must be an email address.') %> @@ -28,14 +34,18 @@ <div id="email_required" class="tooltip" for="email"> <%- gettext('The email field is required.') %> </div> + + <div id="could_not_add" class="tooltip" for="email"> + <%- gettext('We just sent an email to that address! If you really want to send another, wait a minute or two and try again.') %> + </div> + </li> - </ul> - <ul class="inputs password_entry"> - <li class="password_section"> - <a class="forgot right" href="/forgot" tabindex="4"><%- gettext('forgot your password?') %></a> - <label for="password"><%- gettext('Password') %></label> - <input id="password" placeholder="<%- gettext('Your Password') %>" type="password" tabindex="2" maxlength="80"> + <li class="password_entry vpassword_entry"> + <a class="forgot right" href="/forgot"><%- gettext('forgot your password?') %></a> + <label for="password" class="password_entry"><%- gettext('Password') %></label> + <label for="password" class="vpassword_entry"><%- gettext('Your email address is new to us. Please create a password to use with Persona.') %></label> + <input id="password" placeholder="<%- gettext('password') %>" type="password" maxlength="80"> <div id="password_required" class="tooltip" for="password"> <%- gettext('The password field is required.') %> @@ -45,28 +55,59 @@ <%- gettext('This email address and password do not match.') %> </div> + <div class="tooltip" id="password_length" for="password"> + <%- gettext('Password must be between 8 and 80 characters long.') %> + </div> + + </li> + + <li class="vpassword_entry"> + <label for="vpassword" class="hidden"><%- gettext('Verify Password') %></label> + <input id="vpassword" placeholder="<%- gettext('verify password') %>" type="password" maxlength="80"> + + <div id="password_required" class="tooltip" for="vpassword"> + <%- gettext('Verification password is required.') %> + </div> + + <div class="tooltip" id="passwords_no_match" for="vpassword"> + <%- gettext('These passwords don\'t match!') %> + </div> + </li> </ul> - <div class="submit cf forminputs"> - <button tabindex="5"><%- gettext('Sign In') %></button> - <div class="remember cf"> - <a class="action" href="/signup"><%- gettext('New to Persona? Sign up today.') %></a> - </div> + <div class="submit cf forminputs start"> + <button id="signIn"><%- gettext('Next') %></button> </div> - <ul class="notifications"> - <li class="notification" id="verify_primary"> - <p> - <%- format(gettext('To verify that you own <strong %(emailId)>this address</strong>, you must sign in with your provider. A new window will be opened.'), - { emailId: 'id="primary_email"' }) %> - </p> + <div class="submit cf forminputs password_entry"> + <button id="signIn"><%- gettext('Sign In') %></button> + </div> + + <div class="submit cf forminputs vpassword_entry"> + <p class="cf"> + <button id="verifyEmail"><%- gettext('Verify Email') %></button> + </p> - <p class="submit"> - <button id="authWithPrimary"><%- gettext('Verify') %></button> + <p class="tospp cf"> + <%- format( + gettext('By proceeding, you agree to %(persona)\'s <a %(termsLink)>Terms</a> and <a %(privacyLink)>Privacy Policy</a>.'), + { persona: "Persona", + termsLink: 'href="https://login.persona.org/tos" target="_new"', + privacyLink: 'href="https://login.persona.org/privacy" target="_new"', + }) %> </p> - </li> - </ul> + + </div> + + <div class="submit cf forminputs verify_primary"> + <%- format(gettext('To verify that you own <strong %(emailId)>this address</strong>, you must sign in with your provider. A new window will be opened.'), + { emailId: 'id="primary_email"' }) %> + + <p class="submit"> + <button id="authWithPrimary"><%- gettext('Verify') %></button> + </p> + </div> </form> </div> </div> diff --git a/resources/views/signup.ejs b/resources/views/signup.ejs deleted file mode 100644 index 7019371f5eca286d60f36768b0cdd090a5091738..0000000000000000000000000000000000000000 --- a/resources/views/signup.ejs +++ /dev/null @@ -1,123 +0,0 @@ -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - -<div id="hAlign" class="display_always"> - <div id="vAlign"> - <!-- XXX this form submits to nowhere --> - <form id="signUpForm" class="cf authform" novalidate> - <h1><%- gettext('Create Account') %></h1> - - <ul class="notifications"> - <li class="notification alreadyRegistered"> - <%- format(gettext('<strong %(emailId)></strong> is already registered. Would you like to <a %(signInLink)>sign in</a> instead?'), - { emailId: 'id="registeredEmail"', signInLink: 'class="action" href="/signin"' }) %> - </li> - - <li class="notification emailsent"> - <h2><%- gettext('Confirm your email address') %></h2> - - <p> - <%- format(gettext('Check your email at <strong %(emailId)></strong>.'), { emailId: 'id="sentToEmail"' }) %> - </p> - - <p> - <%- gettext('Click the link in the confirmation email. You\'ll then immediately be signed into Persona.') %> - </p> - </li> - - </ul> - - <ul class="inputs forminputs"> - <li> - <label for="email"><%- gettext('Email Address') %></label> - <input id="email" autofocus placeholder="<%- gettext('Your Email') %>" type="email" autocapitalize="off" autocorrect="off" spellcheck="false" maxlength="254" /> - - <div id="email_format" class="tooltip" for="email"> - <%- gettext('This field must be an email address.') %> - </div> - - <div id="email_required" class="tooltip" for="email"> - <%- gettext('The email field is required.') %> - </div> - - <div id="could_not_add" class="tooltip" for="email"> - <%- gettext('We just sent an email to that address! If you really want to send another, wait a minute or two and try again.') %> - </div> - </li> - - <li class="password_entry"> - <label for="password"><%- gettext('Password') %></label> - <input id="password" placeholder="<%- gettext('Password') %>" type="password" maxlength="80"> - - <div id="password_required" class="tooltip" for="password"> - <%- gettext('Password is required.') %> - </div> - - <div class="tooltip" id="password_length" for="password"> - <%- gettext('Password must be between 8 and 80 characters long.') %> - </div> - </li> - - <li class="password_entry"> - <label for="vpassword"><%- gettext('Verify Password') %></label> - <input id="vpassword" placeholder="<%- gettext('Verify Password') %>" type="password" maxlength="80"> - - <div id="password_required" class="tooltip" for="vpassword"> - <%- gettext('Verification password is required.') %> - </div> - - <div class="tooltip" id="passwords_no_match" for="vpassword"> - <%- gettext('These passwords don\'t match!') %> - </div> - - </li> - </ul> - - <div class="submit cf forminputs"> - <p class="cf"> - <button><%- gettext('Verify Email') %></button> - <a class="action remember" href="/signin" tabindex="2"><%- gettext('Existing account? Sign in.') %></a> - </p> - - <p class="tospp"> - <%- format( - gettext('By proceeding, you agree to %(persona)\'s <a %(termsLink)>Terms</a> and <a %(privacyLink)>Privacy Policy</a>.'), - { persona: "Persona", - termsLink: 'href="https://login.persona.org/tos" target="_new"', - privacyLink: 'href="https://login.persona.org/privacy" target="_new"', - }) %> - </p> - - </div> - - <ul class="notifications"> - <!-- This has to go down here because of the button. Firefox clicks the first button in the form whenever the user hits enter in the form, whether the button is shown or not, and even if there is an input[type=submit]. Ghetto. --> - <li class="notification" id="primary_verify"> - <p> - <%- format(gettext('To verify that you own <strong %(emailId)>this address</strong>, you must sign in with your provider. A new window will be opened.'), { emailId: 'id="primary_email"' }) %> - </p> - - <p class="submit"> - <button id="authWithPrimary" tabindex="1"><%- gettext('Verify') %></button> - </p> - </li> - </ul> - - - </form> - - <div class="notification" id="congrats"> - <p><%- gettext('Thank you for signing up with <strong>Persona</strong>. You can now use your Persona account to <em>Sign In</em> or <em>Sign Up</em> to websites all across the web!') %> - </p> - </div> - - </div> -</div> - -<noscript> - <%- gettext('We\'re sorry, Persona requires that Javascript is enabled.') %> -</noscript> - - - diff --git a/resources/views/test.ejs b/resources/views/test.ejs index 7573f5a20438dbd4d3c88276db03c900efa14ed7..46d0e547987662508fdb441c52d28ebb6bb394d6 100644 --- a/resources/views/test.ejs +++ b/resources/views/test.ejs @@ -144,7 +144,6 @@ <script src="/pages/js/forgot.js"></script> <script src="/pages/js/manage_account.js"></script> <script src="/pages/js/signin.js"></script> - <script src="/pages/js/signup.js"></script> <script src="/pages/js/about.js"></script> <script src="testHelpers/helpers.js"></script> @@ -181,7 +180,6 @@ <script src="cases/pages/js/verify_secondary_address.js"></script> <script src="cases/pages/js/forgot.js"></script> <script src="cases/pages/js/signin.js"></script> - <script src="cases/pages/js/signup.js"></script> <script src="cases/pages/js/manage_account.js"></script> <script src="cases/pages/js/about.js"></script> diff --git a/tests/cache-header-tests.js b/tests/cache-header-tests.js index 104ef5f5c6d9bf6d2bc6676cf67a465c87061e22..a41afe9fa533f47868a40da96361dcb57704ce6a 100755 --- a/tests/cache-header-tests.js +++ b/tests/cache-header-tests.js @@ -121,7 +121,6 @@ suite.addBatch({ '/cookies_disabled': hasProperCacheHeaders('/cookies_disabled'), '/relay': hasProperCacheHeaders('/relay'), '/authenticate_with_primary': hasProperCacheHeaders('/authenticate_with_primary'), - '/signup': hasProperCacheHeaders('/signup'), '/idp_auth_complete': hasProperCacheHeaders('/idp_auth_complete'), '/forgot': hasProperCacheHeaders('/forgot'), '/signin': hasProperCacheHeaders('/signin'), diff --git a/tests/page-requests-test.js b/tests/page-requests-test.js index a6fd57988775c0fe5c8cfb04a0811a40fc3695d2..9978f428325bbfd93bdd9e546b9227cfe7c1e2c2 100755 --- a/tests/page-requests-test.js +++ b/tests/page-requests-test.js @@ -55,7 +55,6 @@ function respondsWith(status) { suite.addBatch({ 'GET /': respondsWith(200), - 'GET /signup': respondsWith(200), 'GET /forgot': respondsWith(200), 'GET /signin': respondsWith(200), 'GET /about': respondsWith(200),