Meteor: Facebook username not showing
I have a Facebook login that runs in my app and user page to display the most important details of the user. When I log in using a password, then the following code:
user: function(){
return Meteor.user().username
},
from:
<h1>Welcome {{user}}</h1>
return the username. When I logged in using my Facebook username, the username is blank.
How can I access the current user's username when logged in with Facebook?
thank
+3
Jaspermid
source
to share
2 answers
Thanks to @ user3374348's comment, managed to find it
The Facebook username is in profile.name. So,
return Meteor.user().username || Meteor.user().profile.name
returns either the username, if available, or another Facebook name.
thanks for the help
+7
Jaspermid
source
to share
return Meteor.user().username || Meteor.user().profile.name
This works for me.
+1
許 宸 維
source
to share