Blame view
client/controllers/public/signup.coffee
1.04 KB
d1f4dbea8
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
### Controller: Signup Template: /client/views/public/signup.html ### # Created Template.signup.created = -> # Code to run when template is created goes here. # Rendered Template.signup.rendered = -> # Code to run when template is rendered goes here. # Helpers Template.signup.helpers( example: -> # Code to run for helper function. ) # Events Template.signup.events( |
7439c59f5
|
22 |
'submit form': (e,t) -> |
cabe1c46e
|
23 24 25 26 27 28 |
# Prevent form from submitting. e.preventDefault() # Grab the user's details. user = |
7439c59f5
|
29 30 |
email: t.find('[name="emailAddress"]').value password: t.find('[name="password"]').value |
cabe1c46e
|
31 32 |
# Create the user's account. |
7439c59f5
|
33 34 35 36 37 38 39 40 |
Meteor.call 'createUserAccount', user, (error,response) -> # If the account is created successfully, log the user in using the credentials # from above. if response.success Meteor.loginWithPassword(user.email, user.password, (error)-> alert error.reason if error ) |
d1f4dbea8
|
41 |
) |