Skip to content
Snippets Groups Projects
Commit f4665e4a authored by Shane Tomlinson's avatar Shane Tomlinson
Browse files

Hooking up the new user flow.

Putting the js to handle form submission into the respective ejs file until we have a good way of separating form elements and binding onto individual forms.
parent 33452fa2
No related branches found
No related tags found
No related merge requests found
......@@ -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()
......
......@@ -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>
......
......@@ -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>
......@@ -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>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment