Accounts.onLogin chrome vs firefox


#1

Not sure if it had the same issue as Accounts.onLogin not firing on client side:

However, I had noticed my Accounts.onLogin handler does not get fired on Chrome unless I actually login. So if I press refresh, the handler does not get invoked. On Firefox, the handler gets invoked even on a refresh.

That being said, how do we make it such that it works the same way on both browsers, what I’d like to do is set some default values on the session onLogin.


#2

We are seeing this exact issue too – onLogin fires consistently on Firefox but not on Chrome, with Ubuntu being the worst offender.

We’re subscribing upon login and we found the sockjs/info call was failing in that a utils.delay call was dropped (at ddp-client.js:965). From past experience, I’ve seen setTimeouts get dropped when the DOM isn’t fully loaded, so we wrapped the subscription with a Meteor.startup which helped some – but not fully.

Our current workaround is to issue the subscription both at startup and onLogin. Also see discussion at Issue 5127, as it seems very related.


#3

To close the loop, our workaround is to put the onLogin callback inside a Tracker.autorun — e.g.:

Tracker.autorun(function( running ){
    Meteor.userId() && onLoginCallback();
});