summaryrefslogtreecommitdiffstats
path: root/webapp/src/components/StartPageLogin.vue
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-04 01:14:38 +0100
committerJannik Schönartz2019-03-04 01:14:38 +0100
commit6471511909de79c1f3739ba9d6a5b45b7eb1fadb (patch)
treeb0702eae88cea3ce8fff89f1fa2f91849e79e1ee /webapp/src/components/StartPageLogin.vue
parent[webapp] add option to disable all animations (diff)
downloadbas-6471511909de79c1f3739ba9d6a5b45b7eb1fadb.tar.gz
bas-6471511909de79c1f3739ba9d6a5b45b7eb1fadb.tar.xz
bas-6471511909de79c1f3739ba9d6a5b45b7eb1fadb.zip
[authentication] Restructure api to match our new error code standard
Moved most of the res.send from the lib to the api Fixed frontend to match the new api
Diffstat (limited to 'webapp/src/components/StartPageLogin.vue')
-rw-r--r--webapp/src/components/StartPageLogin.vue8
1 files changed, 4 insertions, 4 deletions
diff --git a/webapp/src/components/StartPageLogin.vue b/webapp/src/components/StartPageLogin.vue
index 87d4054..3e4b5b8 100644
--- a/webapp/src/components/StartPageLogin.vue
+++ b/webapp/src/components/StartPageLogin.vue
@@ -75,7 +75,7 @@ export default {
},
login () {
if (this.$refs.form.validate()) {
- this.$http.post('/api/authentication/login', { username: this.username, password: this.password })
+ this.$http.post('/api/authentication/cookies', { username: this.username, password: this.password })
.then(response => {
const nextRoute = this.$store.state.loginRedirect
if (nextRoute) this.$router.replace(nextRoute)
@@ -83,12 +83,12 @@ export default {
this.$socket.open()
})
.catch(error => {
- if (error.response.data.status === 'USER_NOTFOUND') {
+ if (error.response.data.error === 'USER_NOTFOUND') {
this.usernameError = true
- } else if (error.response.data.status === 'PASSWORD_INVALID') {
+ } else if (error.response.data.error === 'PASSWORD_INVALID') {
this.passwordError = true
} else {
- this.$snackbar({ color: 'error', text: error.response.data.error_message })
+ this.$snackbar({ color: 'error', text: error.response.data.message })
}
this.$refs.form.validate()
})