pw reset done

This commit is contained in:
2023-08-10 13:54:17 +02:00
parent dfda842c7b
commit 0735224dd1
10 changed files with 148 additions and 14 deletions

View File

@@ -32,10 +32,26 @@
methods: {
reset() {
const startNotification = this.$refs.notification.createNotification( 'Starting password reset', 20, 'progress', 'normal' );
this.$refs.notification.cancelNotification( startNotification );
this.$refs.notification.createNotification( 'An account with this email address does not exist.', 5, 'error', 'normal' );
this.$refs.notification.cancelNotification( startNotification );
this.$refs.notification.createNotification( 'Password reset email sent. Please follow the instructions given there.', 30, 'ok', 'normal' );
let fetchOptions = {
method: 'post',
body: JSON.stringify( {'email': this.email } ),
headers: {
'Content-Type': 'application/json',
'charset': 'utf-8'
}
};
fetch( localStorage.getItem( 'url' ) + '/API/resetPW', fetchOptions ).then( res => {
if ( res.status !== 200 ) {
this.$refs.notification.cancelNotification( startNotification );
this.$refs.notification.createNotification( 'An account with this email address does not exist.', 5, 'error', 'normal' );
} else {
this.$refs.notification.cancelNotification( startNotification );
this.$refs.notification.createNotification( 'Password reset email sent. Please follow the instructions given there.', 30, 'ok', 'normal' );
setTimeout( () => {
location.href = '/login';
}, 10000 );
}
} );
}
}
}

View File

@@ -46,6 +46,8 @@
<tr>
<td>
<label for="news">Do you want to potentially get newsletter?</label><br>
</td>
<td>
<input type="checkbox" v-model="formData[ 'newsletter' ]" name="news" id="news"><br><br>
</td>
</tr>