Checking param in URL, based on that param calling some other service. It's working as expected in Chrome/Mozilla/Edge but not in IE11. It's continuously redirecting to the same page.
http://localhost/oauth/?code=xxxxxx
and here are my component code.
ngOnInit() {
this.sub = this.route.queryParams.subscribe(params => {
if (params['code']) {
this.loginProcess = 'Hold tight! Authentication in progress.';
this.authenticationService.getOADAccessToken(params['code']).subscribe(function(res){
// some code
});
else {
// redirect to login page
}
It's getting param code value, after that even its calling getOADAccessToken service call. But before return from service call its falls to else part and again reloading the same page, getting param code and calling service and reloading.
service.ts
getOADAccessToken(token): Observable<any> {
return this.http.post(environment.API + '/getAccessTokens',
{ code: token })
.map((response: Response) => {
const ADResult = response.json();
return response.json();
});
}
It's working in all browsers except IE10/11. Enabled all polyfills in polyfill.ts. Enabled Intl.
Here are the version details:

ifstatement lacks a closing brace}