Yes, it was a rabbit hole! I then saw a post where someone mentioned they
had a service which was routing to '/' and that gave me the hint.
What seems to happen is the authentication token is treated differently in
the different browsers, although I'm unclear why.
The solution was relatively simple - instead of kicking the user out to
home based on their log-in status we do so if they sign out. Unfortunately,
this will mean that if they get 'kicked out' for another reason (we revoke
their credentials for example) it will log them out but stay on the current
view. But that's an edge case.
The method gets invoked but returns the proper authentication state, so in
most cases even if it gets invoked it won't change anything because their
*actual* auth status hasn't changed.
And finally, yes, we had a log showing whether that method was invoked and
it only showed up in Chrome.
Will post any further insights if we get a chance to dig deeper into the
auth API or get any insights from Firebase.
I'm assuming it's happening in this method from the auth API:
_routerMethodOnAuthPromise: function(rejectIfAuthDataIsNull) {
var self = this;
// wait for the initial auth state to resolve; on page load we have
to request auth state
// asynchronously so we don't want to resolve router methods or flash
the wrong state
return this._initialAuthResolver.then(function() {
// auth state may change in the future so rather than depend on the
initially resolved state
// we also check the auth data (synchronously) if a new promise is
requested, ensuring we resolve
// to the current auth state and not a stale/initial state
var authData = self.getAuth(), res = null;
if (rejectIfAuthDataIsNull && authData === null) {
res = self._q.reject("AUTH_REQUIRED");
}
else {
res = self._q.when(authData);
}
return res;
});
},
On Thursday, 26 January 2017 00:09:58 UTC-5, Sander Elias wrote:
Hi D
Enter code here...
> oug,
>
> Thanks for posting, this is one of the things someone might loose a lot of
> time on!
> Have you checked if the state change is truly arriving in chrome? Might be
> that the auth state is handled a bit different in chrome. (as you say, the
> actual state has not changed, so the chrome behaviour is the correct one
> right?)
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.