summaryrefslogtreecommitdiff
path: root/users
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-10-15 12:55:03 +0200
committerAzul <azul@leap.se>2012-10-15 12:55:03 +0200
commit8841958868fdd11ec49ee6de32ff79f1aa6083fa (patch)
tree03da9bc68801b40959c37dd984392b4f8a375498 /users
parent42cf5141bd7743d16259b0771607ea6a8cbc0fd3 (diff)
adding login function for srp
Diffstat (limited to 'users')
-rw-r--r--users/app/assets/javascripts/users.js.coffee9
1 files changed, 8 insertions, 1 deletions
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