summaryrefslogtreecommitdiff
path: root/src/store/modules/Authentication
diff options
context:
space:
mode:
authorDerick Montague <derick.montague@ibm.com>2019-12-11 15:16:40 +0300
committerDerick Montague <derick.montague@ibm.com>2020-01-27 17:38:19 +0300
commitfded0d11289f737a845abb5ee8bb10725f870cf3 (patch)
tree71d3957557de1d261e40dc1db102e6661936f4c5 /src/store/modules/Authentication
parentf3ab8bc86bd10e6d7398970db07d91a28485359d (diff)
downloadwebui-vue-fded0d11289f737a845abb5ee8bb10725f870cf3.tar.xz
Add singlequote override and fix files
Based on phosphor-webui and JavaScript common practices we are setting ESLint to required single quote for JS files and double quote for SCSS files. This commit adds the ESLint override to the prettier rules and runs the npm lint script that fixes the files that violate the rule. Signed-off-by: Derick Montague <derick.montague@ibm.com> Change-Id: I50cba77b2d0797595ce94258029608efa8665005
Diffstat (limited to 'src/store/modules/Authentication')
-rw-r--r--src/store/modules/Authentication/AuthenticanStore.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/store/modules/Authentication/AuthenticanStore.js b/src/store/modules/Authentication/AuthenticanStore.js
index 3512e2da..88456e95 100644
--- a/src/store/modules/Authentication/AuthenticanStore.js
+++ b/src/store/modules/Authentication/AuthenticanStore.js
@@ -1,11 +1,11 @@
-import api from "../../api";
-import Cookies from "js-cookie";
+import api from '../../api';
+import Cookies from 'js-cookie';
const AuthenticationStore = {
namespaced: true,
state: {
- status: "",
- cookie: Cookies.get("XSRF-TOKEN")
+ status: '',
+ cookie: Cookies.get('XSRF-TOKEN')
},
getters: {
authStatus: state => state.status,
@@ -13,35 +13,35 @@ const AuthenticationStore = {
},
mutations: {
authRequest(state) {
- state.status = "loading";
+ state.status = 'loading';
},
authSuccess(state) {
- state.status = "authenticated";
- state.cookie = Cookies.get("XSRF-TOKEN");
+ state.status = 'authenticated';
+ state.cookie = Cookies.get('XSRF-TOKEN');
},
authError(state) {
- state.status = "error";
+ state.status = 'error';
},
logout(state) {
- state.status = "";
- Cookies.remove("XSRF-TOKEN");
+ state.status = '';
+ Cookies.remove('XSRF-TOKEN');
}
},
actions: {
login({ commit }, auth) {
- commit("authRequest");
+ commit('authRequest');
return api
- .post("/login", { data: auth })
- .then(() => commit("authSuccess"))
+ .post('/login', { data: auth })
+ .then(() => commit('authSuccess'))
.catch(error => {
- commit("authError");
+ commit('authError');
throw new Error(error);
});
},
logout({ commit }) {
api
- .post("/logout", { data: [] })
- .then(() => commit("logout"))
+ .post('/logout', { data: [] })
+ .then(() => commit('logout'))
.catch(error => console.log(error));
}
}