summaryrefslogtreecommitdiff
path: root/src/store/modules
diff options
context:
space:
mode:
authorSukanya Pandey <sukapan1@in.ibm.com>2020-04-28 17:48:28 +0300
committerDerick Montague <derick.montague@ibm.com>2020-06-17 23:48:38 +0300
commitb1f559f03e3f464c1b8b19a9327158be0ecafe62 (patch)
tree6af8b850a9aebf58a2f4a08ac9832872e0f80cb3 /src/store/modules
parent5918b48a0530a43a4dd9ee1a3f134846c948011e (diff)
downloadwebui-vue-b1f559f03e3f464c1b8b19a9327158be0ecafe62.tar.xz
Profile settings page
-To set the profile by setting password. -This commit adds a profile page which allows the user to change their password. In the future, the profile page will also contain user settings like language and timezone. The API called to change the user's password is '/redfish/v1/AccountService/Accounts/<userName>' Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com> Change-Id: Ie54a54beff8c85bc9ac5af21c35edc481b34cf44
Diffstat (limited to 'src/store/modules')
-rw-r--r--src/store/modules/Authentication/AuthenticanStore.js1
-rw-r--r--src/store/modules/GlobalStore.js9
2 files changed, 7 insertions, 3 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js
index 7a0c5ba3..407c2b57 100644
--- a/src/store/modules/Authentication/AuthenticanStore.js
+++ b/src/store/modules/Authentication/AuthenticanStore.js
@@ -23,6 +23,7 @@ const AuthenticationStore = {
},
logout() {
Cookies.remove('XSRF-TOKEN');
+ localStorage.removeItem('storedUsername');
}
},
actions: {
diff --git a/src/store/modules/GlobalStore.js b/src/store/modules/GlobalStore.js
index 42e9e2bf..55b07965 100644
--- a/src/store/modules/GlobalStore.js
+++ b/src/store/modules/GlobalStore.js
@@ -31,19 +31,22 @@ const GlobalStore = {
state: {
bmcTime: null,
hostStatus: 'unreachable',
- languagePreference: localStorage.getItem('storedLanguage') || 'en-US'
+ languagePreference: localStorage.getItem('storedLanguage') || 'en-US',
+ username: localStorage.getItem('storedUsername')
},
getters: {
hostStatus: state => state.hostStatus,
bmcTime: state => state.bmcTime,
- languagePreference: state => state.languagePreference
+ languagePreference: state => state.languagePreference,
+ username: state => state.username
},
mutations: {
setBmcTime: (state, bmcTime) => (state.bmcTime = bmcTime),
setHostStatus: (state, hostState) =>
(state.hostStatus = hostStateMapper(hostState)),
setLanguagePreference: (state, language) =>
- (state.languagePreference = language)
+ (state.languagePreference = language),
+ setUsername: (state, username) => (state.username = username)
},
actions: {
async getBmcTime({ commit }) {