From a33337ae0ca388a7ae94730009b113caf0de18f2 Mon Sep 17 00:00:00 2001 From: Akash K <57758277+amk-dev@users.noreply.github.com> Date: Fri, 7 Apr 2023 03:19:18 +0530 Subject: [PATCH] fix: handle user/not_found response from backend (#72) --- packages/hoppscotch-selfhost-web/src/platform/auth.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/hoppscotch-selfhost-web/src/platform/auth.ts b/packages/hoppscotch-selfhost-web/src/platform/auth.ts index f978784af..e95925cb0 100644 --- a/packages/hoppscotch-selfhost-web/src/platform/auth.ts +++ b/packages/hoppscotch-selfhost-web/src/platform/auth.ts @@ -99,6 +99,12 @@ async function setInitialUser() { return } + if (error && error.message === "user/not_found") { + setUser(null) + isGettingInitialUser.value = false + return + } + // cookies sent, but it is expired, we need to refresh the token if (error && error.message === "Unauthorized") { const isRefreshSuccess = await refreshToken()