mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-11-29 11:44:28 +01:00
Fixed UX
This commit is contained in:
@@ -81,7 +81,6 @@ export default {
|
||||
} else {
|
||||
const decodedId = atob(this.$route.params.id)
|
||||
if (!/^\d+$/.test(decodedId)) {
|
||||
console.error('Received ID is invalid')
|
||||
this.$router.push({ name: 'PasswordRecoveryForm' })
|
||||
} else {
|
||||
this.id = this.$route.params.id
|
||||
@@ -119,6 +118,10 @@ export default {
|
||||
err.response.data.errors.forEach(element => {
|
||||
message += this.$gettext(element) + '<br>'
|
||||
})
|
||||
} else if (err.response.status === 429) {
|
||||
this.$refs.observer.setErrors({
|
||||
password: this.$gettext('Too many unsuccessful attempts, please try later.')
|
||||
})
|
||||
}
|
||||
this.password_validation_error = message
|
||||
})
|
||||
|
||||
@@ -110,6 +110,10 @@ export default {
|
||||
}
|
||||
} else if (err.response.status === 503 && err.response.data.type === 'email') {
|
||||
this.showDialog('Error', err.response.data.reason, true)
|
||||
} else if (err.response.status === 429) {
|
||||
this.$refs.observer.setErrors({
|
||||
password: this.$gettext('Too many unsuccessful attempts, please try later.')
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -89,6 +89,10 @@ export default {
|
||||
if (err.response.status === 400) {
|
||||
this.loading = false
|
||||
this.showErrorDialog(this.$t('User seems wrong, return to login or restart reset the process?'))
|
||||
} else if (err.response.status === 429) {
|
||||
this.$refs.observer.setErrors({
|
||||
password: this.$gettext('Too many unsuccessful attempts, please try later.')
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user