summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-10-17 12:06:37 +0200
committerAzul <azul@riseup.net>2012-10-17 12:06:37 +0200
commit5a0ceeb1ca0055719a9b8977a799362163955766 (patch)
tree797bf5fe2dab2fea3b9b0ddb4c6c04be6d33e2e9 /src
parentd21474a0290edab1c765741d484335d83f50be75 (diff)
hand success and error messages to identify by default
also cleaned up some other parts that were not needed anymore
Diffstat (limited to 'src')
-rw-r--r--src/srp.js16
1 files changed, 5 insertions, 11 deletions
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.");
};
};