From 0870fa7e8f16a1da370e9ef9744cae8f6984f7fc Mon Sep 17 00:00:00 2001 From: Ali BARIN Date: Wed, 18 Jan 2023 22:27:35 +0100 Subject: [PATCH] fix(typeform): add HTTP 403 to refresh token --- packages/backend/src/helpers/http-client/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/helpers/http-client/index.ts b/packages/backend/src/helpers/http-client/index.ts index 79a7009c..4752121a 100644 --- a/packages/backend/src/helpers/http-client/index.ts +++ b/packages/backend/src/helpers/http-client/index.ts @@ -44,7 +44,8 @@ export default function createHttpClient({ const { status } = error.response; if ( - status === 401 && + // TODO: provide a `shouldRefreshToken` function in the app + (status === 401 || status === 403) && $.app.auth.refreshToken && !$.app.auth.isRefreshTokenRequested ) {