Skip to content

Commit

Permalink
fix(ui): store RBAC role data as JSON string in local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
activeshadow committed Jul 25, 2023
1 parent 0c2e84a commit 517242e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/js/src/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default new Vuex.Store({
state: {
username: localStorage.getItem( 'phenix.user' ),
token: localStorage.getItem( 'phenix.token' ),
role: localStorage.getItem( 'phenix.role' ),
role: JSON.parse(localStorage.getItem( 'phenix.role' )),
auth: localStorage.getItem( 'phenix.auth' ) === 'true',
next: null,

Expand All @@ -25,7 +25,7 @@ export default new Vuex.Store({
if ( remember ) {
localStorage.setItem( 'phenix.user', state.username );
localStorage.setItem( 'phenix.token', state.token );
localStorage.setItem( 'phenix.role', state.role );
localStorage.setItem( 'phenix.role', JSON.stringify(state.role) );
localStorage.setItem( 'phenix.auth', state.auth );
}

Expand Down

0 comments on commit 517242e

Please sign in to comment.