37
Views
7
Comments
[Local Storage] ClearAllLocalStorage - clears roles?
Question
Forge component by Paulo Cação
8
Published on 15 Jun 2020

Hi -

Doing some tests with this, when we call "ClearAllLocalStorage", the user remains logged in (I think) but they have no roles anymore, and they need to re-login to get their roles back.

Any idea what could be happening here? I tested in a fresh module.

Thanks!

J.Ja

Rank: #222

Hi Justin,

When we use ClearAllLocalStorage we will clear your local variables, this is not related with session:

Regards

Rank: #222

Hi Justin,

I will try check this behavior asap. Maybe the rules are saved in local storage var (or something like that), and when we clear the local storage vars, the user roles are cleared also.


Regards

mvp_badge
MVP
Rank: #18

Hi,

OutSystems stores various data in different Local Storage keys for PWA, including User Role Information in the data attribute of $OS_Users$RolesInfo key.

I would say that the component should not remove any $OS_ variable from local storage.

Regards,

Daniel

Staff
Rank: #192

Hi Daniël, 

This component uses the localStorage API available in each browser. The ClearAllLocalStorage action calls the localStorage.clear() method and so it clears all keys in the storage.

I guess that what we can do is before clearing the storage make a copy of all $OS_ variables and then set them again... That or just remove the ClearAllLocalStorage action and allow only to remove one key at a time. 

Thanks!

Rank: #222

Hi,

I have updated a new version, now you can remove all variable except the OS vars. Update the plugin and enjoy it.

Best Regards,

Paulo