localStorage appEnvironment persists after logout, causing environment mix-up between Editor and Viewer accounts

Hi,

I am currently testing my app by logging in and out of two different accounts in the same browser: one with Editor permissions and the other as a View-only user.

While making edits with the Editor account—which was supposed to only apply to the Production environment—the changes ended up altering the Development environment instead. Upon investigating, I noticed that Retool sets an appEnvironment key in the browser's localStorage to dictate which environment is active.

The problem is that this key persists even after logging out. Because this state is retained, when I log out of the Editor account and log into the Viewer account, the browser keeps the previous environment setting. This causes unintended behavior. I need a way to ensure this localStorage value is wiped the moment a user logs out. Could you help me with this?

Thanks.


Maybe if you force the clear storage when you hit the logout button?

I'm not able to replicate this, @Victor_Prado. In all my testing, localStorage seems to be reset upon logging out. I'm using Chrome, for additional context. There might be something else at play here.

Have you had a chance to revisit this, @Victor_Prado? Let us know if you have any additional questions!