Angular HTTP Interceptor how to chain an observable

后端 未结 3 1504
栀梦
栀梦 2021-01-14 15:43

I am using the Azure AD adal library to do authentication. There is a call to aquire a token that returns an observable. How can this observable be added into the intercept?

3条回答
  •  借酒劲吻你
    2021-01-14 16:12

    request = request.clone({
      setHeaders: {
        Authorization: `Bearer ${token}`
      }
    });
    return next.handle(request);
    

提交回复
热议问题