title: Not able to retry the same request after refresh call in Anuglar
body: <p>I am not able to retry the same request after the refresh call. I have tried <code>next.handle(updated_request)</code> but still, it is not running. Can you please help with this.</p>
  <p>FYI: I have attached my code here. Please let me know, If I missed anything here.</p>
  <pre class="lang-js prettyprint-override"><code>intercept (req: HttpRequest&lt;any&gt;, next: HttpHandler): Observable&lt;HttpEvent&lt;any&gt;&gt; {
    this.presentLoading();
    const headerSettings = req.headers.keys().reduce((acc, cur) =&gt; {
      acc[cur] = req.headers.getAll(cur);
      return acc;
    }, {});
    return fromPromise(this.storage.get('userdata')).pipe(mergeMap((token: any) =&gt; {
      if(token)
        headerSettings[&quot;Authorization&quot;] = token.access_token;
      let headers = new HttpHeaders(headerSettings),
      newRequest = req.clone({ headers });
      return next.handle(newRequest)
        .pipe(catchError((err: any) =&gt; {
            if (err instanceof HttpErrorResponse) {
                // token is expired refresh and try again
                if (err.status === 401) {
                  if(token &amp;&amp; token.refresh_token) {
                    this.login.refresh(token.refresh_token).subscribe((data: any) =&gt; {
                      if(data.data)
                        headerSettings[&quot;Authorization&quot;] = data.data.access_token;
                      headers = new HttpHeaders(headerSettings);
                      let retryRequest = newRequest.clone({ headers });
                      return next.handle(retryRequest);
                    });
                  } else {
                    this.route.navigate(['/tabs/login']);
                  }
                } else {
                  return Observable.throw(err.statusText);
                }
            } else {
                return Observable.throw(err.statusText);
            }
        }));
    }))
  }
  </code></pre>