diff options
Diffstat (limited to 'src/store')
-rw-r--r-- | src/store/modules/Authentication/AuthenticanStore.js | 6 | ||||
-rw-r--r-- | src/store/modules/GlobalStore.js | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js index 88fb54b8..02d6e637 100644 --- a/src/store/modules/Authentication/AuthenticanStore.js +++ b/src/store/modules/Authentication/AuthenticanStore.js @@ -58,10 +58,10 @@ const AuthenticationStore = { .then(() => router.go('/login')) .catch((error) => console.log(error)); }, - checkPasswordChangeRequired(_, username) { - api + getUserInfo(_, username) { + return api .get(`/redfish/v1/AccountService/Accounts/${username}`) - .then(({ data: { PasswordChangeRequired } }) => PasswordChangeRequired) + .then(({ data }) => data) .catch((error) => console.log(error)); }, resetStoreState({ state }) { diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js index 95d7a083..74eb1e80 100644 --- a/src/store/modules/GlobalStore.js +++ b/src/store/modules/GlobalStore.js @@ -40,6 +40,7 @@ const GlobalStore = { : true, username: localStorage.getItem('storedUsername'), isAuthorized: true, + userPrivilege: null, }, getters: { assetTag: (state) => state.assetTag, @@ -51,6 +52,7 @@ const GlobalStore = { isUtcDisplay: (state) => state.isUtcDisplay, username: (state) => state.username, isAuthorized: (state) => state.isAuthorized, + userPrivilege: (state) => state.userPrivilege, }, mutations: { setAssetTag: (state, assetTag) => (state.assetTag = assetTag), @@ -70,6 +72,9 @@ const GlobalStore = { state.isAuthorized = true; }, 100); }, + setPrivilege: (state, privilege) => { + state.userPrivilege = privilege; + }, }, actions: { async getBmcTime({ commit }) { |