diff --git a/front/src/components/auth/Login.vue b/front/src/components/auth/Login.vue index b02a3ed07acb86d65e21686f9de1f1c9af2fc4f6..f84ad9295b1f4a77f67599b769f558d318ee8882 100644 --- a/front/src/components/auth/Login.vue +++ b/front/src/components/auth/Login.vue @@ -73,9 +73,9 @@ export default { // to properly make use of http in the auth service this.$store.dispatch('auth/login', { credentials, - next: this.next, - onError: response => { - if (response.status === 400) { + next: '/library', + onError: error => { + if (error.response.status === 400) { self.error = 'invalid_credentials' } else { self.error = 'unknown_error' diff --git a/front/src/components/auth/Settings.vue b/front/src/components/auth/Settings.vue index f090581ef7305927e293e3f6ffce3e6033131004..4e8f33289b470526539e71ff40f6de32a2857dcb 100644 --- a/front/src/components/auth/Settings.vue +++ b/front/src/components/auth/Settings.vue @@ -37,7 +37,6 @@ <script> import axios from 'axios' -import config from '@/config' import logger from '@/logging' export default { @@ -61,12 +60,16 @@ export default { new_password1: this.new_password, new_password2: this.new_password } - let url = config.BACKEND_URL + 'api/auth/registration/change-password/' + let url = 'auth/registration/change-password/' return axios.post(url, credentials).then(response => { logger.default.info('Password successfully changed') - self.$router.push('/profile/me') - }, response => { - if (response.status === 400) { + self.$router.push({ + name: 'profile', + params: { + username: self.$store.state.auth.username + }}) + }, error => { + if (error.response.status === 400) { self.error = 'invalid_credentials' } else { self.error = 'unknown_error'