Closed whaber closed 4 years ago
Is this meant to be set in all responses? Firebase Cloud Functions/Auth may have our hands tied.
FYI, we're using Firebase's out-of-the-box session management api
Let's start with making this change:
firebase.auth.Auth.Persistence.NONE
Indicates that the state will only be stored in memory and will be cleared when the window or activity is refreshed.
(Leaving a note for myself)
We're also manually saving the mobx store in sessionStorage, which should be removed as well:
// Based on https://egghead.io/lessons/react-store-store-in-local-storage
if (sessionStorage.getItem('store')) {
initialStore = JSON.parse(sessionStorage.getItem('store'))
}
const rootStore = Store.create({
...initialStore,
})
// Based on https://egghead.io/lessons/react-store-store-in-local-storage
onSnapshot(rootStore, (snapshot) => {
sessionStorage.setItem('store', JSON.stringify(snapshot))
})
This potentially allows users of the same computer and/or proxies that may be between the browser and the portal server to access confidential information.
Ref on how to solve: https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html#web-content-caching