From 0db96cce9f83f09b07a46f31f9930e5b7cc19f6f Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Mon, 5 May 2014 14:36:43 +0200 Subject: Fix bugs introduced by the previous patch. --- www/authenticate.js | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) (limited to 'www/authenticate.js') diff --git a/www/authenticate.js b/www/authenticate.js index 2d72480..86d722c 100644 --- a/www/authenticate.js +++ b/www/authenticate.js @@ -1,33 +1,6 @@ jQuery(function($) { - var email; - - navigator.id.beginAuthentication(function(email_) { - email = email_; - $('#email').val(email); - }); - - var onAuthentication = function() { - var password = $('#password').val(); - $.ajax({ - type: 'POST', - url: '/browserid/login.pl', - dataType: 'json', - data: { email: email, password: password }, - success: function(sig, status, xhr) { - console.log("Login successful!"); - navigator.id.completeAuthentication(); - }, - error: function(reason, status, xhr) { - navigator.id.raiseAuthenticationFailure(reason.responseText); - } - }); - return false; - }; - - var onCancel = function() { - navigator.id.cancelAuthentication(); - }; - - $('#auth-form').submit(onAuthentication); - $('.cancel').click(onCancel); + navigator.id.beginAuthentication(function(email) { + var escapedEmail = encodeURIComponent(email); + window.location = 'authenticate.pl?email=' + escapedEmail; + }); }); -- cgit v1.2.3