mirror of
https://github.com/flarum/core.git
synced 2025-07-12 12:26:23 +02:00
Roughly implement change password/email, delete account modals
This commit is contained in:
30
js/forum/src/components/change-password-modal.js
Normal file
30
js/forum/src/components/change-password-modal.js
Normal file
@ -0,0 +1,30 @@
|
||||
import FormModal from 'flarum/components/form-modal';
|
||||
|
||||
export default class ChangePasswordModal extends FormModal {
|
||||
view() {
|
||||
return super.view({
|
||||
className: 'modal-sm change-password-modal',
|
||||
title: 'Change Password',
|
||||
body: [
|
||||
m('p.help-text', 'Click the button below and check your email for a link to change your password.'),
|
||||
m('div.form-group', [
|
||||
m('button.btn.btn-primary.btn-block[type=submit]', 'Send Password Reset Email')
|
||||
])
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
onsubmit(e) {
|
||||
e.preventDefault();
|
||||
this.loading(true);
|
||||
|
||||
m.request({
|
||||
method: 'POST',
|
||||
url: app.config['api_url']+'/forgot',
|
||||
data: {email: app.session.user().email()},
|
||||
background: true
|
||||
}).then(response => {
|
||||
this.hide();
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user