aboutsummaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/auth_flow.js1
-rw-r--r--src/modules/users.js8
2 files changed, 5 insertions, 4 deletions
diff --git a/src/modules/auth_flow.js b/src/modules/auth_flow.js
index 34e15053..d0a90feb 100644
--- a/src/modules/auth_flow.js
+++ b/src/modules/auth_flow.js
@@ -73,6 +73,7 @@ const mutations = {
// actions
const actions = {
+ // eslint-disable-next-line camelcase
async login ({ state, dispatch, commit }, { access_token }) {
commit('setToken', access_token, { root: true })
await dispatch('loginUser', access_token, { root: true })
diff --git a/src/modules/users.js b/src/modules/users.js
index 3cd38d56..d06e77c7 100644
--- a/src/modules/users.js
+++ b/src/modules/users.js
@@ -393,7 +393,7 @@ const users = {
}
},
async getCaptcha (store) {
- return await store.rootState.api.backendInteractor.getCaptcha()
+ return store.rootState.api.backendInteractor.getCaptcha()
},
logout (store) {
@@ -451,9 +451,9 @@ const users = {
// Authentication failed
commit('endLogin')
if (response.status === 401) {
- reject('Wrong username or password')
+ reject(new Error('Wrong username or password'))
} else {
- reject('An error occurred, please try again')
+ reject(new Error('An error occurred, please try again'))
}
}
commit('endLogin')
@@ -462,7 +462,7 @@ const users = {
.catch((error) => {
console.log(error)
commit('endLogin')
- reject('Failed to connect to server, try again')
+ reject(new Error('Failed to connect to server, try again'))
})
})
}