From 4b0fc1dbb3f60a485d3ba7ec27d7654a8ea0d382 Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Mon, 6 Jan 2020 07:36:16 -0800 Subject: Update local user layout and styles MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Derick Montague Change-Id: Ib50ee4d1fb5f14637c9460e77f0682869a86ac8a --- src/store/modules/Authentication/AuthenticanStore.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/store') 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')) -- cgit v1.2.3