From a8b1485b0eeadae51427e850ae864dc5fc65f18a Mon Sep 17 00:00:00 2001 From: Polianin Nikita Date: Thu, 26 Dec 2024 10:40:27 +0300 Subject: [PATCH] fix: do not resend the request if it is not necessary Signed-off-by: Polianin Nikita --- src/api/api.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/api.service.ts b/src/api/api.service.ts index fb44476..040c0c4 100644 --- a/src/api/api.service.ts +++ b/src/api/api.service.ts @@ -68,7 +68,7 @@ export default abstract class ApiService { body: request.data, }).pipe( catchError(error => { - if (!secondTry && error.status === 401) + if (request.needAuth && !secondTry && error.status === 401) return this.handle401Error(error).pipe( switchMap(() => this.sendHttpRequest(method, request, true)) );