mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix(sqllab): don't store user in localstorage (#14722)
* fix(sqllab): remove user info from localstorage * filter out user data when loading localstorage
This commit is contained in:
parent
32622c5081
commit
0e86a6b81c
@ -71,6 +71,12 @@ const sqlLabPersistStateConfig = {
|
||||
}
|
||||
});
|
||||
|
||||
if (subset.sqlLab?.user) {
|
||||
// Don't persist the user.
|
||||
// User should really not be stored under the "sqlLab" field. Oh well.
|
||||
delete subset.sqlLab.user;
|
||||
}
|
||||
|
||||
const data = JSON.stringify(subset);
|
||||
// 2 digit precision
|
||||
const currentSize =
|
||||
@ -81,6 +87,16 @@ const sqlLabPersistStateConfig = {
|
||||
|
||||
return subset;
|
||||
},
|
||||
merge: (initialState, persistedState = {}) => {
|
||||
const result = {
|
||||
...initialState,
|
||||
...persistedState,
|
||||
};
|
||||
// Filter out any user data that may have been persisted in an older version.
|
||||
// Get user from bootstrap data instead, every time
|
||||
result.sqlLab.user = initialState.sqlLab.user;
|
||||
return result;
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user