1
0
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:
Toby Zerner
2015-05-26 18:03:02 +09:30
parent a4a0092513
commit e5532d9618
7 changed files with 123 additions and 8 deletions

View 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();
});
}
}