You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using restangular library in my application
in error addErrorInterceptor config I want to repeat request if user access token expires after refreshing the token. here is piece of my code:
.addErrorInterceptor((response, subject, responseHandler) => {
if (response.status === 401) {
authService.refreshAccesstoken()
.pipe(
switchMap(refreshAccesstokenResponse => {
console.log(refreshAccesstokenResponse) // this is new token
response.request.headers.set('Authorization', `Bearer ${refreshAccesstokenResponse}`)
return response.repeatRequest(response.request.clone());
})
)
.subscribe(
res => {
console.log(res);
responseHandler(res)
},
err => subject.error(err)
);
return false; // error handled
}
after setting headers, they are not updating, it still send old headers
The text was updated successfully, but these errors were encountered:
Hello, I am using restangular library in my application
in error
addErrorInterceptor
config I want to repeat request if user access token expires after refreshing the token. here is piece of my code:after setting headers, they are not updating, it still send old headers
The text was updated successfully, but these errors were encountered: