(options)
| 49 | } |
| 50 | |
| 51 | constructor (options) { |
| 52 | super(options) |
| 53 | this.successfullyRecovered = this.successfullyRecovered.bind(this) |
| 54 | this.recoverAccountHandler = filterKeyboardEvents([13], (e) => { |
| 55 | this.playSound('menu-button-click') |
| 56 | forms.clearFormAlerts(this.$el) |
| 57 | const { |
| 58 | |
| 59 | } = forms.formToObject(this.$el) |
| 60 | if (!email) { return } |
| 61 | if (!utils.isValidEmail(email)) { |
| 62 | return noty({ text: $.i18n.t('form_validation_errors.invalidEmail'), layout: 'center', type: 'error', timeout: 3000 }) |
| 63 | } |
| 64 | const res = $.post('/auth/reset', { email }, this.successfullyRecovered) |
| 65 | res.fail(genericFailure) |
| 66 | return this.enableModalInProgress(this.$el) |
| 67 | }) // TODO: part of forms |
| 68 | } |
| 69 | |
| 70 | recoverAccount (e) { |
| 71 | return this.recoverAccountHandler(e) |
nothing calls this directly
no test coverage detected