summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2012-11-23 15:33:33 +0100
committerAzul <azul@riseup.net>2012-11-23 15:33:33 +0100
commit32719dee1d9a4d6ce717eef948dedd54f77b288b (patch)
tree0f150d992fb6ebddf418f36f658a44be201fdc86
parent076d6e251e4caf826787d87b11434e535960455c (diff)
addToForm: add the srp signup data to an existing form
-rw-r--r--src/jqueryRest.js14
-rw-r--r--src/srp.js8
2 files changed, 21 insertions, 1 deletions
diff --git a/src/jqueryRest.js b/src/jqueryRest.js
index bc3bb51..abc53d4 100644
--- a/src/jqueryRest.js
+++ b/src/jqueryRest.js
@@ -18,6 +18,9 @@ srp.remote = (function(){
});
}
+ function addSignupToForm(session) {
+ }
+
return {
register: register,
handshake: handshake,
@@ -38,6 +41,17 @@ srp.remote = (function(){
.fail(error)
};
+ function addToForm(){
+ form = this.target;
+ $.each(srp.session.signup(), function(key, value) {
+ form.append($('<input/>', {
+ type: 'hidden',
+ name: key
+ value: value
+ }));
+ }
+ }
+
function receiveSalts(response){
// B = 0 will make the algorithm always succeed
// -> refuse such a server answer
diff --git a/src/srp.js b/src/srp.js
index c754818..cbfdd10 100644
--- a/src/srp.js
+++ b/src/srp.js
@@ -10,9 +10,15 @@ var srp = (function(){
srp.remote.login();
};
+ function addToForm()
+ {
+ srp.remote.addToForm();
+ };
+
return {
signup: signup,
- login: login
+ login: login,
+ addToForm: addToForm
}
}());