I'm a complete newbie and I was messing around with a Meteor 1.0 note list app to connect google oauth to it.
When I do this, the page no longer displays correctly because {{username}} is not set at all.
https://docs.meteor.com/#/full/meteor_users says "username: unique string identifying the user." but oauth stuff doesn't create it for you.
Connect the service to an existing account meteor says that the existing account is connected to another service, but in this case I just want to use an external service.
https://stackoverflow.com/questions/25182903/meteor-facebook-registration uses onCreateUser () for manual installation
user.username = user.services.facebook.name
but this is not portable between services and does not guarantee uniqueness.
https://github.com/aldeed/meteor-collection2 defines the user's scheme so that the username is required.
When I delete the user table (some fields are deleted), the google account does not have a username, and there is no field that can really take this value automatically, as there may be a conflict. You can use email, but I would prefer that the username is not an email address. Am I just forcing the user to enter the desired username?
meteor:PRIMARY> db.users.find() { "_id" : "YNWt2cATMsKFG7od6", "createdAt" : ISODate("2014-11-05T11:08:00.406Z"), "services" : { "password" : { }, }, "username" : "a_user" } { "_id" : "CyQsJqcez3kWTRHyQ", "createdAt" : ISODate("2014-11-05T12:09:40.139Z"), "profile" : { "name" : "Alice User" }, "services" : { "google" : { "email" : " a_user@example.com ", "family_name" : "User", "gender" : "female", "given_name" : "Alice", "id" : "1115", "name" : "Alice User, } } }
What is the correct way to solve this problem?