summaryrefslogtreecommitdiff
path: root/users/app/assets/javascripts/users.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'users/app/assets/javascripts/users.js.coffee')
-rw-r--r--users/app/assets/javascripts/users.js.coffee20
1 files changed, 10 insertions, 10 deletions
diff --git a/users/app/assets/javascripts/users.js.coffee b/users/app/assets/javascripts/users.js.coffee
index ab437f6..75440ea 100644
--- a/users/app/assets/javascripts/users.js.coffee
+++ b/users/app/assets/javascripts/users.js.coffee
@@ -27,21 +27,21 @@ validOrAbort = (event) ->
abortIfErrors()
-signup = (event) ->
- srp = new SRP(jqueryRest())
- srp.register ->
- window.location = '/'
-login = (event) ->
- srp = new SRP(jqueryRest())
- srp.identify ->
- window.location = '/'
+srp.session = new srp.Session()
+srp.signedUp = ->
+ window.location = '/'
+srp.loggedIn = ->
+ window.location = '/'
+
+srp.error = (message) ->
+ alert(message)
$(document).ready ->
$('#new_user').submit preventDefault
$('#new_user').submit validOrAbort
- $('#new_user').submit signup
+ $('#new_user').submit srp.signup
$('#new_session').submit preventDefault
- $('#new_session').submit login
+ $('#new_session').submit srp.login