(Closed) Insert Username in Collection with Accounts-ui

Thank you so much for all your help!

Now i don’t get any errors or logs in the console. It doesn’t say if there’s a error or the services are not yet available. I’ve tryed signed in and out which still doens’t give any feedback.

Nevermind! It says:

Services not yet available. Try again later

I’ve reached my maximum number of posts today and have to wait 10 hours. Can i contact you by email, skype or something @rhywden?

That’s because you still execute the login immediately. And if when the client executes his bit of code faster than the server (i.e. the server hasn’t gotten to the service setup yet) then you will run into this.

Put a login button on the page, use a Template event to deal with clicks on this button and then execute this code.

http://docs.meteor.com/#/full/template_events
http://docs.meteor.com/#/full/eventmaps

Just created a new account.

Now i’ve added this to posts.html:

button class=“login”>Login {{foo}}</button

And this to posts.js:

‘click .login’: function (event) {
return console.log(“foo”); to posts.js.

Do you then want the Login service on the button?

Template.whateveryournamedthetemplate.events({
    'click .login': function(e) {
        Meteor.loginWithFacebook({ ... });
    }
});

Hey @rhywden!

I’ve just added the code and pulled to github. Now it doens’t give me any feedback whether it’s an error or not loaded.

I figured it out.

author: {
        type: String,
        label: "Author",
        autoValue: function() {
            return Meteor.user().profile.name
        },
        autoform: {
            type: "hidden"
        }
    }