diff options
Diffstat (limited to 'users/app/assets/javascripts')
m--------- | users/app/assets/javascripts/srp | 0 | ||||
-rw-r--r-- | users/app/assets/javascripts/users.js.coffee | 24 |
2 files changed, 14 insertions, 10 deletions
diff --git a/users/app/assets/javascripts/srp b/users/app/assets/javascripts/srp -Subproject d6a78049f3356d9d645143362eca74434410bf6 +Subproject 23350b54ec2723e1b2e333626567c9fe9d1e264 diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee index 160a7f0..24302fe 100644 --- a/users/app/assets/javascripts/users.js.coffee +++ b/users/app/assets/javascripts/users.js.coffee @@ -25,17 +25,21 @@ validate_password = (event) -> return true -insert_verifier = (event) -> - # TODO: verify password confimation - srp = new SRP - 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') +signup = (event) -> + srp = new SRP(jqueryRest()) + srp.register -> + window.location = '/' + false + +login = (event) -> + srp = new SRP(jqueryRest()) + 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 |