mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 05:14:23 +00:00
pw reset done
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user