title: How to wait return statement if subscriber not completed in angular 2/4/6
body: <p>Currently I am working on the Angular6 project, and I have auth-http-interceptor. The problem in this file is that I want to get refresh token/acquire token from angular4-adal service every time, and for that, I have to subscribe the acquire token which will give the token and then want to assign that token in authReq object.</p>
  
  <p>But my intercept method's return type is Observable. </p>
  
  <p>Then how could I wait for subscribing the acquire token and then return next.handle(authReq).
  I have tried to write the below code, but its throwing an error => <strong>A function whose declared type is neither 'void' nor 'any' must return a value.</strong></p>
  
  <blockquote>
    <p>auth-http-interceptor.ts</p>
  </blockquote>
  
  <pre><code>@Injectable()
  export class AuthHttpInterceptor implements HttpInterceptor {
      constructor(private adalService: AdalService, private loaderService: LoaderService) { }
  
      intercept(req: HttpRequest&lt;any&gt;, next: HttpHandler): Observable&lt;HttpEvent&lt;any&gt;&gt; {
          this.adalService.acquireToken('###myTenantId').subscribe((token) =&gt; {
              this.loaderService.display(true);
              const authReq = req.clone({
                  url: environment.apiUrl + req.url,
                  headers: req.headers
                  .set('Content-Type', 'application/json')
                  .set('Authorization', 'Bearer ' + token)
              });
          return next.handle(authReq).finally(() =&gt; this.loaderService.display(false));
          });
      }
  }
  </code></pre>
  
  <p>Any help is appreciated.</p>