mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 20:02:01 +08:00
Merge pull request #1119 from palash-signoz/logout
fix: logout the user if api is not successfull
This commit is contained in:
commit
4a4ad7a3da
@ -2,6 +2,7 @@
|
|||||||
import { notification } from 'antd';
|
import { notification } from 'antd';
|
||||||
import getLocalStorageApi from 'api/browser/localstorage/get';
|
import getLocalStorageApi from 'api/browser/localstorage/get';
|
||||||
import loginApi from 'api/user/login';
|
import loginApi from 'api/user/login';
|
||||||
|
import { Logout } from 'api/utils';
|
||||||
import Spinner from 'components/Spinner';
|
import Spinner from 'components/Spinner';
|
||||||
import { LOCALSTORAGE } from 'constants/localStorage';
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
||||||
import ROUTES from 'constants/routes';
|
import ROUTES from 'constants/routes';
|
||||||
@ -103,7 +104,7 @@ function PrivateRoute({ children }: PrivateRouteProps): JSX.Element {
|
|||||||
history.push(ROUTES.UN_AUTHORIZED);
|
history.push(ROUTES.UN_AUTHORIZED);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
history.push(ROUTES.SOMETHING_WENT_WRONG);
|
Logout();
|
||||||
|
|
||||||
notification.error({
|
notification.error({
|
||||||
message: response.error || t('something_went_wrong'),
|
message: response.error || t('something_went_wrong'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user