How to update the user's verified email after social facebook login


I’ve been using Meteor for a couple months and it has grown on me a lot, Aldeed Collections and Yogi Admin seem good enough to be in the core… but that topics for another day.

I’m trying to update my emails array schema after success account create and here’s what I get:

    type: [Object]
    optional: true

    type: String
    regEx: SimpleSchema.RegEx.Email

    type: Boolean

Accounts.onCreateUser (options,user) ->
  username = null
  parseInstagram = (options) ->
    console.log  'parseInstagram', options, user
    o = {}
    if options?.services?.instagram
      o.profilePicture =
      o.fullName = =

  parseFb = (user) ->
    console.log  'parseFb', user
    o = {}
    if user?.services?.facebook
      getFbProfile = (accessToken) ->
        result = undefined
        url = ",birthday,about,email,bio,address&access_token=#{accessToken}"
        result = Meteor.http.get(url)
      data = getFbProfile( user?.services?.facebook?.accessToken )
      o.fullName = user?.services?.facebook?.name
      o.emails = [{ address: data?.email, verified: true }] if data?.email
      o.profilePicture = "" + user?.services? + "/picture/?type=large"
    else undefined

No email seems to go in, while other fields go in happily.
Thanks for your help before I hack this with a _.defer function to update the user after the facet.

Sorry, i just had to set it on the user object… i didn’t realize that. It was a simple fix.