mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-14 07:48:37 +02:00
Fix missing notifications in Auth views
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<form-wrapper :title="$t('auth.forms.reset_password')" :fail="fail" :success="success">
|
||||
<form-wrapper :title="$t('auth.forms.reset_password')">
|
||||
<form @submit.prevent="handleSubmit" @keydown="form.onKeydown($event)">
|
||||
<form-field :form="form" fieldName="email" inputType="email" :label="$t('auth.forms.email')" autofocus />
|
||||
<form-buttons :isBusy="form.isBusy" :caption="$t('auth.forms.send_password_reset_link')" :showCancelButton="true" cancelLandingView="login" />
|
||||
@ -14,8 +14,6 @@
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
success: '',
|
||||
fail: '',
|
||||
form: new Form({
|
||||
email: '',
|
||||
})
|
||||
@ -27,19 +25,29 @@
|
||||
|
||||
this.form.post('/api/password/email', {returnError: true})
|
||||
.then(response => {
|
||||
|
||||
this.success = response.data.status
|
||||
|
||||
this.$notify({ type: 'is-success', text: response.data.status, duration:-1 })
|
||||
})
|
||||
.catch(error => {
|
||||
if( error.response.data.requestFailed ) {
|
||||
this.fail = error.response.data.requestFailed
|
||||
|
||||
this.$notify({ type: 'is-danger', text: error.response.data.requestFailed, duration:-1 })
|
||||
}
|
||||
else if( error.response.status !== 422 ) {
|
||||
|
||||
this.$router.push({ name: 'genericError', params: { err: error.response } });
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
beforeRouteLeave (to, from, next) {
|
||||
this.$notify({
|
||||
clean: true
|
||||
})
|
||||
|
||||
next()
|
||||
}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user