mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-15 15:05:53 +08:00
fix: logout is fixed
This commit is contained in:
parent
12c14f71ba
commit
429e3bbd0d
@ -5,6 +5,7 @@ import history from 'lib/history';
|
||||
import store from 'store';
|
||||
import {
|
||||
LOGGED_IN,
|
||||
UPDATE_ORG,
|
||||
UPDATE_USER,
|
||||
UPDATE_USER_ACCESS_REFRESH_ACCESS_TOKEN,
|
||||
UPDATE_USER_ORG_ROLE,
|
||||
@ -51,5 +52,12 @@ export const Logout = (): void => {
|
||||
},
|
||||
});
|
||||
|
||||
store.dispatch({
|
||||
type: UPDATE_ORG,
|
||||
payload: {
|
||||
org: [],
|
||||
},
|
||||
});
|
||||
|
||||
history.push(ROUTES.LOGIN);
|
||||
};
|
||||
|
@ -12,6 +12,7 @@ import {
|
||||
UPDATE_CURRENT_VERSION,
|
||||
UPDATE_LATEST_VERSION,
|
||||
UPDATE_LATEST_VERSION_ERROR,
|
||||
UPDATE_ORG,
|
||||
UPDATE_ORG_NAME,
|
||||
UPDATE_USER,
|
||||
UPDATE_USER_ACCESS_REFRESH_ACCESS_TOKEN,
|
||||
@ -193,6 +194,13 @@ const appReducer = (
|
||||
};
|
||||
}
|
||||
|
||||
case UPDATE_ORG: {
|
||||
return {
|
||||
...state,
|
||||
org: action.payload.org,
|
||||
};
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ export const UPDATE_USER_IS_FETCH = 'UPDATE_USER_IS_FETCH';
|
||||
export const UPDATE_USER_ORG_ROLE = 'UPDATE_USER_ORG_ROLE';
|
||||
export const UPDATE_USER = 'UPDATE_USER';
|
||||
export const UPDATE_ORG_NAME = 'UPDATE_ORG_NAME';
|
||||
export const UPDATE_ORG = 'UPDATE_ORG';
|
||||
|
||||
export interface SwitchDarkMode {
|
||||
type: typeof SWITCH_DARK_MODE;
|
||||
@ -102,6 +103,13 @@ export interface UpdateOrgName {
|
||||
};
|
||||
}
|
||||
|
||||
export interface UpdateOrg {
|
||||
type: typeof UPDATE_ORG;
|
||||
payload: {
|
||||
org: AppReducer['org'];
|
||||
};
|
||||
}
|
||||
|
||||
export type AppAction =
|
||||
| SwitchDarkMode
|
||||
| LoggedInUser
|
||||
@ -113,4 +121,5 @@ export type AppAction =
|
||||
| UpdateUserIsFetched
|
||||
| UpdateUserOrgRole
|
||||
| UpdateUser
|
||||
| UpdateOrgName;
|
||||
| UpdateOrgName
|
||||
| UpdateOrg;
|
||||
|
Loading…
x
Reference in New Issue
Block a user