Skip to content

Commit

Permalink
πŸ› : fix error on authentication at loading
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubuisson committed Apr 9, 2020
1 parent 07a1fee commit e5ad303
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/client/app/shared/store/modules/session-store-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
const sessionState = {
login: false,
authenticated: false,
user: null,
authorities: null,
user: {},
authorities: [],
};

const sessionGetters = {
hasAuthorities: (state) => (authorities) => {
if (!state.authenticated || !state.authorities) return false;

if (!authorities) return true;
let authoritiesToCheck = authorities;
if (typeof authorities === 'string') {
authoritiesToCheck = [authorities];
Expand All @@ -37,8 +37,8 @@ const sessionMutations = {
logout: (state) => {
state.login = false;
state.authenticated = false;
state.user = null;
state.authorities = null;
state.user = {};
state.authorities = [];
},
};

Expand Down

0 comments on commit e5ad303

Please sign in to comment.