diff --git a/browserid/static/js/browserid.js b/browserid/static/js/browserid.js
index 76e66f0ea3e7f4a6a2f8a256dee8c68764196007..451f3a369d0b1801120c446afea8a005f840163f 100644
--- a/browserid/static/js/browserid.js
+++ b/browserid/static/js/browserid.js
@@ -135,26 +135,6 @@ $(function() {
     }
   });
 
-  // This is for the signup page
-  $("#signUpForm").bind("submit", function(event) {
-    event.preventDefault();
-
-    var email = $("#email").val(),
-        password = $("#password").val();
-    
-    BrowserIDNetwork.authenticate(email, password, function onSuccess(authenticated) {
-      if (authenticated) {
-        document.location = '/';
-      }
-      else {
-        // bad authentication
-      }
-    }, function onFailure() {
-      // Wah wah.  Network error
-    });
-  });
-
-
 });
 
 function display_saved_ids()
diff --git a/browserid/views/layout.ejs b/browserid/views/layout.ejs
index 50df1e2dadcdfd9bf6edd0422e59c161a8ec2658..e13d8d9111e867160e0d990a8c8fc72f3dd0b325 100644
--- a/browserid/views/layout.ejs
+++ b/browserid/views/layout.ejs
@@ -14,6 +14,8 @@
 
     <script src="/js/jquery-1.6.2.min.js" type="text/javascript"></script>
     <script src="/dialog/resources/storage.js" type="text/javascript"></script>
+    <script src="/dialog/resources/crypto-api.js" type="text/javascript"></script>
+    <script src="/dialog/resources/crypto.js" type="text/javascript"></script>
     <script src="/dialog/resources/browserid-network.js" type="text/javascript"></script>
     <script src="/dialog/resources/browserid-identities.js" type="text/javascript"></script>
     <script src="/dialog/resources/underscore-min.js" type="text/javascript"></script>
diff --git a/browserid/views/signin.ejs b/browserid/views/signin.ejs
index 3eae1fd67069ae55d84b7a28f3618ddc78b5a2bf..0288c769de132ac0594bb028bd3c08b3c3e8b7e7 100644
--- a/browserid/views/signin.ejs
+++ b/browserid/views/signin.ejs
@@ -33,6 +33,25 @@
 
 <script type="text/javascript">
   $(document).ready(function () {
-    $('form input:visible:first').focus();
+    $("form input:visible:first").focus();
+
+    $("#signUpForm").bind("submit", function(event) {
+      event.preventDefault();
+
+      var email = $("#email").val(),
+          password = $("#password").val();
+      
+      BrowserIDNetwork.authenticate(email, password, function onSuccess(authenticated) {
+        if (authenticated) {
+          document.location = "/";
+        }
+        else {
+          // bad authentication
+        }
+      }, function onFailure() {
+        // Wah wah.  Network error
+      });
+    });
+
   });
 </script>
diff --git a/browserid/views/signup.ejs b/browserid/views/signup.ejs
index 6207496ff024a94fb01934e27115e0e6c75bfc9e..33b4654dc0c8d0dc61427b18633e5825198758a9 100644
--- a/browserid/views/signup.ejs
+++ b/browserid/views/signup.ejs
@@ -29,6 +29,25 @@
 
 <script type="text/javascript">
   $(document).ready(function () {
-    $('form input:visible:first').focus();
+    $("form input:visible:first").focus();
+
+    $("#signUpForm").bind("submit", function(event) {
+      event.preventDefault();
+
+      var email = $("#email").val(),
+          password = $("#password").val();
+      
+      BrowserIDIdentities.stageIdentity(email, password, function onSuccess(authenticated) {
+        if (authenticated) {
+          document.location = "/";
+        }
+        else {
+          // bad authentication
+        }
+      }, function onFailure() {
+        // Wah wah.  Network error
+      });
+    });
+
   });
 </script>