From 5a0ceeb1ca0055719a9b8977a799362163955766 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 17 Oct 2012 12:06:37 +0200 Subject: hand success and error messages to identify by default also cleaned up some other parts that were not needed anymore --- src/srp.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/srp.js b/src/srp.js index e66c2fa..c986443 100644 --- a/src/srp.js +++ b/src/srp.js @@ -9,8 +9,10 @@ function SRP(remote, session) this.session = session; // Start the login process by identifying the user - this.identify = function() + this.identify = function(success, error) { + srp.success = success; + srp.error = error; remote.handshake(session, receive_salts); // Receive login salts from the server, start calculations @@ -64,18 +66,10 @@ function SRP(remote, session) }; // This function is called when authentication is successful. - // Developers can set this to other functions in specific implementations - // and change the functionality. + // It's a dummy. Please hand the real thing to the call to identify. this.success = function() { - var forward_url = document.getElementById("srp_forward").value; - if(forward_url.charAt(0) != "#") - window.location = forward_url; - else - { - window.location = forward_url; - alert("Login successful."); - } + alert("Login successful."); }; }; -- cgit v1.2.3