From 6a1f447f4155796ca9b2510c49f52559b3934c17 Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 20 Nov 2012 12:25:17 +0100 Subject: make sure srp.login also works as a callback --- src/srp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/srp.js') diff --git a/src/srp.js b/src/srp.js index e57b7e9..c754818 100644 --- a/src/srp.js +++ b/src/srp.js @@ -2,12 +2,12 @@ var srp = (function(){ function signup() { - this.remote.signup(); + srp.remote.signup(); }; function login() { - this.remote.login(); + srp.remote.login(); }; return { -- cgit v1.2.3 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/srp.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/srp.js') 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 From fff770a866b44abce6fe0fc5d5ffde034225436d Mon Sep 17 00:00:00 2001 From: Azul Date: Sun, 25 Nov 2012 12:55:00 +0100 Subject: API: update instead of addToForm addToForm was an attempt to not use ajax but just the normal form submit. Turns out it's easy to add hidden fields to the form but quite cumbersome to remove the password fields from teh form so they are not submitted over the eventually untrusted channel. So we use ajax for updates just like for signup. --- src/srp.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/srp.js') diff --git a/src/srp.js b/src/srp.js index cbfdd10..efd50d2 100644 --- a/src/srp.js +++ b/src/srp.js @@ -10,15 +10,15 @@ var srp = (function(){ srp.remote.login(); }; - function addToForm() + function update(submitEvent) { - srp.remote.addToForm(); + srp.remote.update(submitEvent); }; return { signup: signup, - login: login, - addToForm: addToForm + update: update, + login: login } }()); -- cgit v1.2.3