Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: handle user/not_found response from backend (#72)

Akash Ka33337ae0ca3
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()