nicolaslopezj / meteor-apollo-accounts

Meteor accounts in GraphQL
MIT License
146 stars 37 forks source link

createUser is not storing username #59

Closed joncursi closed 7 years ago

joncursi commented 7 years ago

I am trying to sign up new users with createUser using email, password, profile, and username. I noticed that username field is not being stored in the Mongo documents, even though I can confirm on the front-end that username is indeed being sent as part of the object payload.

createUser({
  email: 'test@test.com',
  password: 'some password',
  profile: {
    name: 'Test User',
  },
  username: 'testusername',
}, apollo);
{
    "_id" : "xyTByAWkFj7Z3NrGs",
    "createdAt" : ISODate("2017-05-22T16:23:08.279Z"),
    "services" : {
        "password" : {
            "bcrypt" : "$2a$10$rfZeR/08fNZIQBddFbSCfuYIH7pc2ghbA2g0/3OKSiYq5sF7IqKsa"
        },
        "resume" : {
            "loginTokens" : [ 
                {
                    "when" : ISODate("2017-05-22T16:23:08.289Z"),
                    "hashedToken" : "kL5AHPwpSNIc4xFLQF3R+jUK7JpBKk4j46BDX76Nugw="
                }
            ]
        }
    },
    "emails" : [ 
        {
            "address" : "test@test.com",
            "verified" : false
        }
    ],
    "profile" : {
        "name" : "Test User"
    }
}
joncursi commented 7 years ago

I didn't realize my simpl-schema setup that I pulled off the tutorial didn't have a username field, so it was getting filtered out!