Reputation: 3270
Please advise as the best way to handle the following situation:
I created a custom sign-up form with:
These are stored in the "Profile" array in the user account document.
I just tied in Facebook login to my app and it worked, however it stores things differently than I initially setup. I'm using handlebars helpers to display a users firstname, but Facebook info is stored as "name: full name"
What's the best way to deal with this?
So when a user creates an account using the meteor password system:
{{currentUser.profile.firstname}} <- works
But if they use Facebook it does not, becaues it's stored in "name" instead of firstname.
Just some ideas or best practices needed.
Thank you!
Upvotes: 0
Views: 99
Reputation: 7898
Use the Accounts.onCreateUser()
callback on the server to normalize the user document before it's saved in the database.
http://docs.meteor.com/#accounts_oncreateuser
Upvotes: 1