summaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorJannik Schönartz2019-02-26 03:46:36 +0100
committerJannik Schönartz2019-02-26 03:46:36 +0100
commitcf1b40542c41b3c78e83650e4e73e596c85ff160 (patch)
treed10d2f5061815e95fc56e43f1675eb127416e255 /webapp
parent[webapp/groups] fix wrong tabbar color (diff)
downloadbas-cf1b40542c41b3c78e83650e4e73e596c85ff160.tar.gz
bas-cf1b40542c41b3c78e83650e4e73e596c85ff160.tar.xz
bas-cf1b40542c41b3c78e83650e4e73e596c85ff160.zip
[account] Fix for the changePassword method
User upadate changes didn't hashed the new password correctly changePassword from promises reworked to async / await (much cleaner) Check weather the usertable is empty is now a get request and not mixed in the post request
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/components/AccountModule.vue2
-rw-r--r--webapp/src/components/StartPageSetup.vue4
-rw-r--r--webapp/src/components/UserModuleEdit.vue8
3 files changed, 9 insertions, 5 deletions
diff --git a/webapp/src/components/AccountModule.vue b/webapp/src/components/AccountModule.vue
index 013f916..f24da2c 100644
--- a/webapp/src/components/AccountModule.vue
+++ b/webapp/src/components/AccountModule.vue
@@ -315,7 +315,7 @@ export default {
},
submitPassword () {
if (this.$refs.passwordForm.validate()) {
- this.$http.post('/api/users/' + this.user.id + '/password', { passwordCurrent: this.passwordCurrent, passwordNew: this.passwordNew }).then(response => {
+ this.$http.post('/api/users/' + this.user.id + '/password', { passwordCurrent: this.passwordCurrent, password: this.passwordNew }).then(response => {
this.cancelEditPassword()
this.$snackbar({ color: 'success', text: this.$t('passwordChanged') })
}).catch(error => {
diff --git a/webapp/src/components/StartPageSetup.vue b/webapp/src/components/StartPageSetup.vue
index 8d41f81..36ad648 100644
--- a/webapp/src/components/StartPageSetup.vue
+++ b/webapp/src/components/StartPageSetup.vue
@@ -72,12 +72,14 @@ export default {
},
beforeRouteEnter (to, from, next) {
// If there are already users in the db, redirect to the login page.
- Vue.prototype.$http.post('/api/authentication/setup').then(result => {
+ Vue.prototype.$http.get('/api/authentication/setup').then(result => {
if (result.data.status !== 'SUCCESS') {
next({ name: 'login' })
} else {
next()
}
+ }).catch(() => {
+ next({ name: 'login' })
})
}
}
diff --git a/webapp/src/components/UserModuleEdit.vue b/webapp/src/components/UserModuleEdit.vue
index 924a109..e989c11 100644
--- a/webapp/src/components/UserModuleEdit.vue
+++ b/webapp/src/components/UserModuleEdit.vue
@@ -3,12 +3,14 @@
"en": {
"titleExisting": "Edit user",
"titleNew": "Create user",
- "userCreated": "User was successfully created."
+ "userCreated": "User was successfully created.",
+ "userUpdated": "User was successfully updated."
},
"de": {
"titleExisting": "Benutzer bearbeiten",
"titleNew": "Benutzer erstellen",
- "userCreated": "Benutzer wurde erfolgreich erstellt."
+ "userCreated": "Benutzer wurde erfolgreich erstellt.",
+ "userUpdated": "Benutzer wurde erfolgreich aktualisiert."
}
}
</i18n>
@@ -67,7 +69,7 @@ export default {
}).then(response => {
this.$store.dispatch('users/loadData')
this.setDialog({ show: false })
- this.$snackbar({ color: 'success', text: this.$t('userCreated') })
+ this.$snackbar({ color: 'success', text: this.dialog.info.id ? this.$t('userUpdated') : this.$t('userCreated') })
}).catch(error => {
if (error.response.data.status === 'USER_ALREADY_EXISTS') {
this.$refs.editComponent.setUsernameTakenError()