2 days later, found my problem. Am posting here in case someone else comes
across this.
In this case, the answer had to do with Firebase. Because the site has
log-in, you check for authorization state. If the authorization state has
changed, it pushes the user out to the home page.
What's interesting about this, is the ACTUAL state of the user hasn't
changed. But this method gets triggered.
What's also interesting is that this state change doesn't get triggered on
Chrome....which is the expected behavior.
vm.auth.$onAuthStateChanged(function(firebaseUser) {
if (firebaseUser) {
vm.validUser = firebaseUser;
userAdmin(firebaseUser.uid);
//console.log("Signed in as:", firebaseUser.uid);
} else {
//console.log("Signed out");
$location.path('/');
}
});
On Wednesday, 25 January 2017 17:06:20 UTC-5, Doug Thompson wrote:
>
> I've read most of the threads on using html5Mode and have ended up with a
> confounding situation.
>
> My current implementation WORKS in Google Chrome desktop, but does NOT
> work in Firefox, Google Chrome mobile or Safari. Am using Angular 1.5
>
> Behaviour:
>
> - Site works. All links lead to non-hash URLs
> - Refresh a URL or input the URL manually
> - Shows page briefly (less 1/4 second)
> - Redirects to index page instead of the input URL
> - Behavior occurs on browsers noted but not Google Chrome
>
> All browsers are latest release
>
> I have:
>
> 1 Set rewrites on server (Firebase)
>
> rewrites": [
> {
> "source": "**",
> "destination": "/index.html"
> }]
> }
>
>
> 2 Implemented base href using "/" but also using "https://domain.com"
>
> <meta name="viewport" content="width=device-width, initial-scale=1.0,
> maximum-scale=1.0, user-scalable=no" />
> <base href="/">
>
> 3 Implemented html5Mode(true):
>
> $locationProvider.hashPrefix("!");
> $locationProvider.html5Mode(true);
>
>
> 4. Set routes
>
> .config (function config($routeProvider) {
> console.log('go to purchase route provider');
> $routeProvider.when('/purchase', {
> templateUrl: 'sections/purchase/purchase.html',
> controller: 'PurchaseCtrl'
> });
> })
>
>
> CONSOLE LOG:
> You can see that the intended controller DOES get called, but then it gets
> knocked out to the main module which then redirects it to "/".
>
> go to purchase route provider purchase.module.js:4:5 // Correct - this
> is the intended route and controller
> do we configure> app.module.js:31:6 // Incorrect, somehow the URL call
> has sent the app back to app.module
> Current state null app.module.js:33:6 // history.state showing as null
> go to landing controller landing.module.js:19:3 // Sends it to the
> controller at route"/"
>
> Mystified.
>
>
>
>
--
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.