javascript - Meteor.js on login event -


so i'm rather new meteor framework , javascript in general, i'm working on little project using framework try , bring myself scratch. i'm working on micro blogging site.

at moment users able log in through several services, fb, google etc. , retrieve avatars via service id inserted needed url, works fine. want user able see own avatar log in means need run javascript right after login successful. @ point in time cant find on onlogin style event. , have hacked handlebars template run code when user logs in. code appears run once , if user logs out , in don't see avatar anymore.

does know of event can use this?

here hacky template

{{#if currentuser}}     {{> userinput}} {{/if}} 

here js calls

$('#inputavatar').css('background-image', 'url('+avatarurl+')'); 

i appreciate help, i'm sure it's simple i've overlooked cant seem figure out!

thanks, peter.

i don't know if way you're doing appropriate following on client side detect if user logged in:

tracker.autorun(function(){   if(meteor.userid()){     //do stuff   } }); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -