summaryrefslogtreecommitdiff
path: root/src/store/modules/Authentication/AuthenticanStore.js
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2020-03-11 21:48:42 +0300
committerDerick Montague <derick.montague@ibm.com>2020-03-13 20:35:42 +0300
commita06fe4695e7e4c09ea07540d3353cb05c36f1e37 (patch)
treee80d14d14601130f89555c616ee27f4cbd1d8ff3 /src/store/modules/Authentication/AuthenticanStore.js
parent7223a9fb310ab2f5665b7247d8f24144cbacbede (diff)
downloadwebui-vue-a06fe4695e7e4c09ea07540d3353cb05c36f1e37.tar.xz
Fix accessibility violations and use b-form-group
- Update authError to be set to false in order to hide the error message when the user logs in. This is needed if the user name or password are incorrect multiple times. If it is not hidden between login attempts, the user will only be notified on the first attempt. - Use the b-form-group component for consistency. - Add id attributes to the required field error messages so that the error can be added to the input field's aria-describedby attribute Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I86902cc2c85b3bbf156c2920ec2031ee4dccd2ef
Diffstat (limited to 'src/store/modules/Authentication/AuthenticanStore.js')
-rw-r--r--src/store/modules/Authentication/AuthenticanStore.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js
index 975f258b..d64c7308 100644
--- a/src/store/modules/Authentication/AuthenticanStore.js
+++ b/src/store/modules/Authentication/AuthenticanStore.js
@@ -17,8 +17,8 @@ const AuthenticationStore = {
state.authError = false;
state.cookie = Cookies.get('XSRF-TOKEN');
},
- authError(state) {
- state.authError = true;
+ authError(state, authError = true) {
+ state.authError = authError;
},
logout() {
Cookies.remove('XSRF-TOKEN');
@@ -26,6 +26,7 @@ const AuthenticationStore = {
},
actions: {
login({ commit }, auth) {
+ commit('authError', false);
return api
.post('/login', { data: auth })
.then(() => commit('authSuccess'))