Accounts username

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: '',
  profile: {
    firstName: 'John',
    lastName: 'Doe'

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

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

mongol and mongo query.


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

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

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?

You need to configure the useraccounts package to use usernames: