Skip to content

Commit

Permalink
use the existing Accounts method call
Browse files Browse the repository at this point in the history
Calling the existing Accounts.createUser will also handle sending the verification email (if configured) for creating users
  • Loading branch information
scole96 committed Dec 26, 2013
1 parent 794b729 commit c2b2cfc
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions client/views/signUp/signUp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,16 @@ Template.entrySignUp.events
if err
console.log err
if valid
Meteor.call('accountsCreateUser', username, email, password, (err, data) ->
newUserData =
email: email
password: password
profile: profile: AccountsEntry.settings.defaultProfile || {}
if username
data.username = username
Accounts.createUser newUserData, (err, data) ->
if err
Session.set('entryError', err.reason)
return


#login on client
if _.contains([
'USERNAME_AND_EMAIL',
Expand All @@ -129,7 +133,6 @@ Template.entrySignUp.events
Meteor.loginWithPassword(username, password)

Router.go AccountsEntry.settings.dashboardRoute
)
else
Session.set('entryError', i18n("error.signupCodeIncorrect"))
return
Expand Down

0 comments on commit c2b2cfc

Please sign in to comment.