mirror of
https://github.com/flarum/core.git
synced 2025-07-31 13:40:20 +02:00
Add specific error message when an email address is not found in forgot password modal
This commit is contained in:
@@ -85,7 +85,8 @@ export default class ForgotPasswordModal extends Modal {
|
||||
app.request({
|
||||
method: 'POST',
|
||||
url: app.forum.attribute('apiUrl') + '/forgot',
|
||||
data: {email: this.email()}
|
||||
data: {email: this.email()},
|
||||
errorHandler: this.onerror.bind(this)
|
||||
})
|
||||
.then(() => {
|
||||
this.success = true;
|
||||
@@ -94,4 +95,12 @@ export default class ForgotPasswordModal extends Modal {
|
||||
.catch(() => {})
|
||||
.then(this.loaded.bind(this));
|
||||
}
|
||||
|
||||
onerror(error) {
|
||||
if (error.status === 404) {
|
||||
error.alert.props.children = app.translator.trans('core.forum.forgot_password.not_found_message');
|
||||
}
|
||||
|
||||
super.onerror(error);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user