summaryrefslogtreecommitdiff
path: root/users/app/assets
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-10-17 12:39:40 +0200
committerAzul <azul@leap.se>2012-10-17 12:39:40 +0200
commitfdfdc86eb96f670a580eb58b1b3d41560a269ac1 (patch)
tree5abb8760209151f48be4971eb0fa375a66efad36 /users/app/assets
parentb85316cc00f53343bc6555b10c79f9aadd86e06f (diff)
improved signup and login js
Diffstat (limited to 'users/app/assets')
m---------users/app/assets/javascripts/srp0
-rw-r--r--users/app/assets/javascripts/users.js.coffee16
2 files changed, 6 insertions, 10 deletions
diff --git a/users/app/assets/javascripts/srp b/users/app/assets/javascripts/srp
-Subproject d21474a0290edab1c765741d484335d83f50be7
+Subproject 5a0ceeb1ca0055719a9b8977a79936216395576
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