I am currently working on implementing a logout feature in my application. I initiate a call to the /logout web service and receive a URL as a response. I then use this URL to redirect my page accordingly.
Below is the code snippet:
constructor(
$q: ng.IQService,
$location: ng.ILocationService,
$window: ng.IWindowService,
$http: ng.IHttpService
) {
this._$q = $q;
this._$location = $location;
this._$window = $window;
this.logout = () => {
return $http
.get(logoutUri, {})
.success((resp:any): void => {
window.location.href = resp;
});
};
}
Although I receive the correct URL in the 'resp' variable, my page does not get redirected to the intended location.