Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

chore: Private Wrapper is updated (#1029)

palash-signozc969b5f329be
diff --git a/frontend/src/AppRoutes/Private.tsx b/frontend/src/AppRoutes/Private.tsx
index e6b23b8467..2426628430 100644
--- a/frontend/src/AppRoutes/Private.tsx
+++ b/frontend/src/AppRoutes/Private.tsx
@@ -65,6 +65,8 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
useEffect(() => {
(async (): Promise<void> => {
try {
+ const isLocalStorageLoggedIn =
+ getLocalStorageApi(LOCALSTORAGE.IS_LOGGED_IN) === 'true';
if (currentRoute) {
const { isPrivate, key } = currentRoute;
@@ -98,19 +100,15 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
history.push(ROUTES.UN_AUTHORIZED);
}
} else {
+ history.push(ROUTES.SOMETHING_WENT_WRONG);
+
notification.error({
message: response.error || t('something_went_wrong'),
});
}
} else {
// user does have localstorage values
- dispatch({
- type: UPDATE_USER_IS_FETCH,
- payload: {
- isUserFetching: false,
- },
- });
- history.push(ROUTES.LOGIN);
+ navigateToLoginIfNotLoggedIn(isLocalStorageLoggedIn);
}
} else {
navigateToLoginIfNotLoggedIn();
@@ -133,9 +131,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
}
} else {
// not found
- navigateToLoginIfNotLoggedIn(
- getLocalStorageApi(LOCALSTORAGE.IS_LOGGED_IN) === 'true',
- );
+ navigateToLoginIfNotLoggedIn(isLocalStorageLoggedIn);
}
} catch (error) {
// something went wrong