An easy way to obtain the first name


I created a custom field with user accounts with “first_name” and “last_name”: I want to obtain the first name in a email generated account, facebook account or gmail. How i can made that?

My layout code.

// Called by routes.js
import React from 'react';
import { createContainer } from 'meteor/react-meteor-data';

// Components
import TopMenu from '../components/header/top_menu';
import MainMenu from '../components/header/main_menu';

const MainLayout = (props) => (
    <TopMenu user={props.user} userData={props.userData} first_name={props.first_name}/>
    <MainMenu />

export default createContainer(props => {
  userData = (!Meteor.user()) ? null : Meteor.user();
  first_name = function() {
    if (userData) {
      if (userData.profile.first_name) {
        return userData.profile.first_name;
      else if ( {
      else if ( {
      else return 'error';
    else return 'Cargando ...';
  return {
    user: Meteor.userId(),
    userData: userData,
    first_name: first_name()
}, MainLayout);

I’m search for an easy way to obtain the first name.

Thanks :slight_smile: