From 32719dee1d9a4d6ce717eef948dedd54f77b288b Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 23 Nov 2012 15:33:33 +0100 Subject: addToForm: add the srp signup data to an existing form --- src/jqueryRest.js | 14 ++++++++++++++ src/srp.js | 8 +++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src') 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($('', { + 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 } }()); -- cgit v1.2.3