Accounts username


#1

Using the accounts-password package and useraccounts:core for login, reset password etc.

I need to create users on the server and when I do so the username is not being set, why?

$user = Accounts.createUser({
  username: 'johndoe',
  password: 'password',
  email: 'test@email.site',
  profile: {
    firstName: 'John',
    lastName: 'Doe'
  }
});

This creates a user with email, password and profile but no username.


#2

This should work. How do you check user has no username?


#3

mongol and mongo query.

db.users.findOne() 

returns user object, I don’t see any username, all the other properties are there?


#4

nvm, I have a user schema and forgot to include username in it. er doy


#5

Hi @jplack could you advise how to include username? I have the same issue too using useraccounts, but i also note my login/signup page doesnt have username input and neither do i have a “user” collection, however it still worked before i implemented useraccounts.

I use Meteor.users.findOne();

Also when I submit stuff, the username is suppoed to be recorded but its not showing up?


#6

You need to configure the useraccounts package to use usernames: http://stackoverflow.com/questions/30016263/meteor-missing-username-meteor-users-findone-or-meteor-users/#answer-30419591