Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If no Meteor Account #4

Open
AppDevGuy opened this issue Oct 10, 2015 · 0 comments
Open

If no Meteor Account #4

AppDevGuy opened this issue Oct 10, 2015 · 0 comments

Comments

@AppDevGuy
Copy link

If the user following the tutorial has not got a Meteor account, the profile user name will be empty. Can I suggest the following inside the Template.input.events function:

if (Meteor.user()){
    // since we are logged in using github, let's use the github user name
    var name = Meteor.user().services.github.username;;

    // if you want to use your Meteor name use:
    // var name = Meteor.user().profile.name;
    var message = document.getElementById('message');
}
else{
    var name = 'Anonymous';
    var message = document.getElementById('message');
}

Kind regards

AppDevGuy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant