I am using ui-router in an angular site I'm making, but cant get it to allow routes through to my server. I have facebook oauth authentication on my server, where I navigate to /auth/facebook
and the server will redirect to fb, intercept the callback and redirect the client back to the homepage.
It works fine when navigating to the /auth/facebook
url in a browser it works fine, but ui-router watches location and intercepts all of my location changes.
Any ideas how I can make a url request bypass the $urlRouterProvider.otherwise(...)
statement to allow a route through to my api server? I've tried adding route redirects with the router provider, but it won't trigger a remote call.
Thanks to the guys at angular-dart: As a workaround you could create an ng-click handler that does window.location.assign('/auth/facebook')
to bypass the router
You can handle such requests in your app config with $urlRouterProvider:
$urlRouterProvider.when('/auth/:provider', function() {
window.location.reload();
});
Second solution:
Add target="_self"
to your link like this:
<a target="_self" ng-href="{{'/auth/'+provider}}">{{provider}}</a>
Duplicate of: angular.js link behaviour - disable deep linking for specific URLs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With