diff options
author | Azul <azul@riseup.net> | 2012-11-23 15:33:33 +0100 |
---|---|---|
committer | Azul <azul@riseup.net> | 2012-11-23 15:33:33 +0100 |
commit | 32719dee1d9a4d6ce717eef948dedd54f77b288b (patch) | |
tree | 0f150d992fb6ebddf418f36f658a44be201fdc86 /src | |
parent | 076d6e251e4caf826787d87b11434e535960455c (diff) |
addToForm: add the srp signup data to an existing form
Diffstat (limited to 'src')
-rw-r--r-- | src/jqueryRest.js | 14 | ||||
-rw-r--r-- | src/srp.js | 8 |
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 @@ -10,9 +10,15 @@ var srp = (function(){ srp.remote.login(); }; + function addToForm() + { + srp.remote.addToForm(); + }; + return { signup: signup, - login: login + login: login, + addToForm: addToForm } }()); |