I'm following this answer https://stackoverflow.com/a/13870972 - but it's not working for me.
I copied all the files verbatim, and even added supplementary smart packages such as underscore _.pick
, and http Meteor.http.get
just in case it was required, and mistakenly left out.
Anyhoo - I get github to authorize my app, but Meteor.users in the web console and db.users.findOne()
on the local mongo instance show that Accounts.OnCreateUser()
didn't add any new information to my user profile [that I'm pulling in from github]. In other words, {{currentUser.profile.avatar_url}}
and {{currentUser.profile.login}}
won't reveal anything following that tutorial. So I get blank info on the screen.
I tried that screencasts first attempt, and noticed that {loginButtons}}
returns values for {{currentUser.profile.login}}
. I've reviewed the code many times for typos, but feel that something is quite off with Accounts.onCreateUser(fn)
...
I'm using Meteor 0.5.7, and if anyone else has experienced this problem following that screencast, please let me know. Thanks,
Author of the screencast here. And as of a few seconds ago, a new user on your site :-). So, it looks like login is working on your site. But I'm guessing what's happening in your app is the login info isn't available yet at the time of rendering or at the time you're printing to the console. The reason is that all of that info is being populated asynchronously. It takes a few seconds for the process to complete. If you're relying on Meteor.user().profile data in your templates you need to check first if the login process is still underway.
To do that, you can use either the Meteor.loggingIn()
javascript function or the {{#if loggingIn}}
handlebars block helper. That function is "reactive" which means once the result changes from true
to false
your UI will update. So the template might look something like this:
<template name="loginDependentWidget">
{{#if loggingIn}}
Logging In
{{else}}
{{currentUser.profile.avatar_url}}
{{/if}}
</template>
Does this help?