fix: remove redundant superuser only if it has never logged in (#2582)
fix: Remove redundant superuser only if it has never logged in The code changes in `utils.py` check if the superuser exists and if it has never logged in. If both conditions are true, the superuser is deleted from the database. This improves the efficiency and security of the application.
This commit is contained in:
parent
4d5a0df8d1
commit
7e222187e4
3 changed files with 5 additions and 12 deletions
|
|
@ -131,14 +131,6 @@ function ApiInterceptor() {
|
|||
if (res?.data?.access_token && res?.data?.refresh_token) {
|
||||
login(res?.data?.access_token);
|
||||
}
|
||||
if (error?.config?.headers) {
|
||||
delete error.config.headers["Authorization"];
|
||||
error.config.headers["Authorization"] = `Bearer ${cookies.get(
|
||||
"access_token_lf",
|
||||
)}`;
|
||||
const response = await axios.request(error.config);
|
||||
return response;
|
||||
}
|
||||
} catch (error) {
|
||||
clearBuildVerticesState(error);
|
||||
logout();
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ export const useFolderStore = create<FoldersStoreType>((set, get) => ({
|
|||
if (id) {
|
||||
getFolderById(id).then((res) => {
|
||||
const setAllFlows = useFlowsManagerStore.getState().setAllFlows;
|
||||
setAllFlows(res.flows);
|
||||
setAllFlows(res?.flows);
|
||||
set({ selectedFolder: res });
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue