From 42cf5141bd7743d16259b0771607ea6a8cbc0fd3 Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 15 Oct 2012 11:44:07 +0200 Subject: updated srp_js --- users/app/assets/javascripts/srp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'users/app/assets') diff --git a/users/app/assets/javascripts/srp b/users/app/assets/javascripts/srp index d6a7804..6feb770 160000 --- a/users/app/assets/javascripts/srp +++ b/users/app/assets/javascripts/srp @@ -1 +1 @@ -Subproject commit d6a78049f3356d9d645143362eca74434410bf62 +Subproject commit 6feb77060140fe8026812970c4d5ea83da3cd200 -- cgit v1.2.3 From 8841958868fdd11ec49ee6de32ff79f1aa6083fa Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 15 Oct 2012 12:55:03 +0200 Subject: adding login function for srp --- users/app/assets/javascripts/users.js.coffee | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'users/app/assets') diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee index 160a7f0..07dbc32 100644 --- a/users/app/assets/javascripts/users.js.coffee +++ b/users/app/assets/javascripts/users.js.coffee @@ -27,7 +27,7 @@ validate_password = (event) -> insert_verifier = (event) -> # TODO: verify password confimation - srp = new SRP + srp = new SRP(jqueryRest()) salt = srp.session.getSalt() $('#srp_salt').val(salt) $('#srp_password_verifier').val(srp.session.getV().toString(16)) @@ -35,7 +35,14 @@ insert_verifier = (event) -> $('#srp_password').val('cleared out - use verifier instead') $('#srp_password_confirmation').val('using srp - store verifier') +login = (event) -> + srp = new SRP(jqueryRest()) + srp.identify() + false + + $(document).ready -> $('#new_user').submit validate_password $('#new_user').submit insert_verifier + $('#new_session').submit login -- cgit v1.2.3 From b85316cc00f53343bc6555b10c79f9aadd86e06f Mon Sep 17 00:00:00 2001 From: Azul Date: Tue, 16 Oct 2012 17:29:11 +0200 Subject: working version of srp_js --- users/app/assets/javascripts/srp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'users/app/assets') diff --git a/users/app/assets/javascripts/srp b/users/app/assets/javascripts/srp index 6feb770..d21474a 160000 --- a/users/app/assets/javascripts/srp +++ b/users/app/assets/javascripts/srp @@ -1 +1 @@ -Subproject commit 6feb77060140fe8026812970c4d5ea83da3cd200 +Subproject commit d21474a0290edab1c765741d484335d83f50be75 -- cgit v1.2.3 From fdfdc86eb96f670a580eb58b1b3d41560a269ac1 Mon Sep 17 00:00:00 2001 From: Azul Date: Wed, 17 Oct 2012 12:39:40 +0200 Subject: improved signup and login js --- users/app/assets/javascripts/srp | 2 +- users/app/assets/javascripts/users.js.coffee | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'users/app/assets') diff --git a/users/app/assets/javascripts/srp b/users/app/assets/javascripts/srp index d21474a..5a0ceeb 160000 --- a/users/app/assets/javascripts/srp +++ b/users/app/assets/javascripts/srp @@ -1 +1 @@ -Subproject commit d21474a0290edab1c765741d484335d83f50be75 +Subproject commit 5a0ceeb1ca0055719a9b8977a799362163955766 diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee index 07dbc32..1c00663 100644 --- a/users/app/assets/javascripts/users.js.coffee +++ b/users/app/assets/javascripts/users.js.coffee @@ -25,24 +25,20 @@ validate_password = (event) -> return true -insert_verifier = (event) -> - # TODO: verify password confimation +signup = (event) -> srp = new SRP(jqueryRest()) - salt = srp.session.getSalt() - $('#srp_salt').val(salt) - $('#srp_password_verifier').val(srp.session.getV().toString(16)) - # clear the password so we do not submit it - $('#srp_password').val('cleared out - use verifier instead') - $('#srp_password_confirmation').val('using srp - store verifier') + srp.register() + false login = (event) -> srp = new SRP(jqueryRest()) - srp.identify() + srp.identify -> + window.location = '/' false $(document).ready -> $('#new_user').submit validate_password - $('#new_user').submit insert_verifier + $('#new_user').submit signup $('#new_session').submit login -- cgit v1.2.3