diff --git a/client/controllers/public/signup.coffee b/client/controllers/public/signup.coffee index b306ad8..93f476d 100644 --- a/client/controllers/public/signup.coffee +++ b/client/controllers/public/signup.coffee @@ -30,11 +30,13 @@ Template.signup.events( password: t.find('[name="password"]').value # Create the user's account. - Meteor.call 'createUserAccount', user, (error,response) -> + Meteor.call 'createUserAccount', user, (error) -> # If the account is created successfully, log the user in using the credentials # from above. - if response.success + if error + alert error.reason + else Meteor.loginWithPassword(user.email, user.password, (error)-> alert error.reason if error ) diff --git a/server/admin/accounts.coffee b/server/admin/accounts.coffee index c4144cf..1a66ba7 100644 --- a/server/admin/accounts.coffee +++ b/server/admin/accounts.coffee @@ -2,10 +2,6 @@ Accounts Server side account creation and manipulation methods. - NPM Requires: - - Fibers (https://www.npmjs.org/package/fibers) - - Futures (https://www.npmjs.org/package/fibers) - Configuration: - forbidClientAccountCreation: Disallow client side account creation. @@ -13,10 +9,6 @@ - createUserAccount: Performs a server-side account creation using the Meteor Accounts Password package. ### -# NPM Requires -Future = Npm.require('fibers/future'); -Fibers = Npm.require('fibers'); - # Configuration: Accounts.config( forbidClientAccountCreation: true @@ -31,23 +23,6 @@ Meteor.methods( pattern = { email: String, password: String } check(user, pattern) - # Define the Future so we can return to the client later. - createUserAccount = new Future() - - # Run the Timeout function and create the user. - setTimeout(-> - - # Run Meteor code in a Fiber. - # Note: Accounts.createUser does NOT allow a callback on the server, so we currently - # cannot check to see if an error took place. - Fibers(-> - Accounts.createUser(user) - # Send a faux response back to the client. - createUserAccount.return({"success": "Account successfully created!"}) - ).run() - - ,300) - - # Wait for the process to complete. - createUserAccount.wait() + # Create the user. + Accounts.createUser(user) )