mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
SECURITY: rate limit change email requests
This commit is contained in:
@@ -34,8 +34,13 @@ export default ObjectController.extend({
|
||||
this.set('saving', true);
|
||||
return this.get('content').changeEmail(this.get('newEmail')).then(function() {
|
||||
self.set('success', true);
|
||||
}, function() {
|
||||
}, function(data) {
|
||||
self.setProperties({ error: true, saving: false });
|
||||
if (data.responseJSON && data.responseJSON.errors && data.responseJSON.errors[0]) {
|
||||
self.set('errorMessage', data.responseJSON.errors[0]);
|
||||
} else {
|
||||
self.set('errorMessage', I18n.t('user.change_email.error'));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
{{#if error}}
|
||||
<div class="control-group">
|
||||
<div class="instructions">
|
||||
<div class='alert alert-error'>{{i18n user.change_email.error}}</div>
|
||||
<div class='alert alert-error'>{{errorMessage}}</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user