summaryrefslogtreecommitdiff
path: root/src/store
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2020-01-06 18:36:16 +0300
committerYoshie Muranaka <yoshiemuranaka@gmail.com>2020-01-31 01:33:12 +0300
commit4b0fc1dbb3f60a485d3ba7ec27d7654a8ea0d382 (patch)
tree0b2c344755c9c0c58681b95c4d452d661267fbda /src/store
parent6109113cc9e7e481b6f37b25c329ac64fcb7dbfc (diff)
downloadwebui-vue-4b0fc1dbb3f60a485d3ba7ec27d7654a8ea0d382.tar.xz
Update local user layout and styles
Resubmitting after reverted–original commit here https://gerrit.openbmc-project.xyz/c/openbmc/webui-vue/+/28790 - Add BVConfig plugin to modify boostrap component defaults - Add vuelidate - Add package and basic validations to user form - Add all user form validations - Add checks for edit user - Create VuelidateMixin for shared methods - Update Login to use Vuelidate Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: Ib50ee4d1fb5f14637c9460e77f0682869a86ac8a
Diffstat (limited to 'src/store')
-rw-r--r--src/store/modules/Authentication/AuthenticanStore.js17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js
index 3a554b6b..8d8898ef 100644
--- a/src/store/modules/Authentication/AuthenticanStore.js
+++ b/src/store/modules/Authentication/AuthenticanStore.js
@@ -4,35 +4,28 @@ import Cookies from 'js-cookie';
const AuthenticationStore = {
namespaced: true,
state: {
- status: '',
+ authError: false,
cookie: Cookies.get('XSRF-TOKEN')
},
getters: {
- authStatus: state => state.status,
+ authError: state => state.authError,
isLoggedIn: state => !!state.cookie
},
mutations: {
- authRequest(state) {
- state.status = 'processing';
- },
authSuccess(state) {
- state.status = 'authenticated';
+ state.authError = false;
state.cookie = Cookies.get('XSRF-TOKEN');
},
authError(state) {
- state.status = 'error';
- },
- authReset(state) {
- state.status = '';
+ state.authError = true;
},
logout(state) {
- state.status = '';
+ state.authError = false;
Cookies.remove('XSRF-TOKEN');
}
},
actions: {
login({ commit }, auth) {
- commit('authRequest');
return api
.post('/login', { data: auth })
.then(() => commit('authSuccess'))