-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
store username with new user #86
Changes from 4 commits
510c7d4
6086a17
d7d8c69
ad41835
0fa1fb9
6180385
f09c105
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
signUpErrorMap = { | ||
'User validation failed': 'error.userValidationFailed', | ||
'Email already exists.': 'error.emailAlreadyExists', | ||
'Username already exists.': 'error.usernameAlreadyExists' | ||
} | ||
|
||
Template.entrySignUp.helpers | ||
showEmail: -> | ||
fields = AccountsEntry.settings.passwordSignupFields | ||
|
@@ -120,31 +114,27 @@ Template.entrySignUp.events | |
console.log err | ||
if valid | ||
newUserData = | ||
username: username | ||
email: email | ||
password: password | ||
profile: AccountsEntry.settings.defaultProfile || {} | ||
if username | ||
newUserData.username = username | ||
Accounts.createUser newUserData, (err, data) -> | ||
if err | ||
errorMsg = signUpErrorMap[err.reason] | ||
errorMsg = 'error.unknown' if errorMsg is undefined | ||
Session.set('entryError', i18n(errorMsg)) | ||
T9NHelper.accountsError err | ||
return | ||
#login on client | ||
if _.contains([ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we nuking setting the profile here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I though I deleted this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still think we don't want this line removed... Are you removing it on purpose for some reason? |
||
'USERNAME_AND_EMAIL', | ||
'EMAIL_ONLY'], AccountsEntry.settings.passwordSignupFields) | ||
Meteor.loginWithPassword(email, password, (error) -> | ||
if error | ||
Session.set('entryError', i18n("error.unknown")) | ||
T9NHelper.accountsError err | ||
else | ||
Router.go AccountsEntry.settings.dashboardRoute | ||
) | ||
else | ||
Meteor.loginWithPassword(username, password, (error) -> | ||
if error | ||
Session.set('entryError', i18n("error.unknown")) | ||
T9NHelper.accountsError err | ||
else | ||
Router.go AccountsEntry.settings.dashboardRoute | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you actually speak German? I've just been using Google Translate to fill these in so far, I figured it would botch pretty bad and I feel like my gut was right in the this case :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes