Question

Please advise as the best way to handle the following situation:

I created a custom sign-up form with:

  1. Firstname
  2. Lastname
  3. Email
  4. Password
  5. More

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!

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top