mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 13:45:54 +08:00
UX: Add reset password email button when confirming password before enabling 2FA.
This commit is contained in:
parent
a94dc0c731
commit
4791b39773
@ -4,6 +4,8 @@ import { popupAjaxError } from 'discourse/lib/ajax-error';
|
||||
|
||||
export default Ember.Controller.extend({
|
||||
loading: false,
|
||||
resetPasswordLoading: false,
|
||||
resetPasswordProgress: '',
|
||||
password: null,
|
||||
secondFactorImage: null,
|
||||
secondFactorKey: null,
|
||||
@ -61,6 +63,19 @@ export default Ember.Controller.extend({
|
||||
.finally(() => this.set('loading', false));
|
||||
},
|
||||
|
||||
resetPassword() {
|
||||
this.setProperties({
|
||||
resetPasswordLoading: true,
|
||||
resetPasswordProgress: ''
|
||||
});
|
||||
|
||||
return this.get('model').changePassword().then(() => {
|
||||
this.set('resetPasswordProgress', I18n.t('user.change_password.success'));
|
||||
})
|
||||
.catch(popupAjaxError)
|
||||
.finally(() => this.set('resetPasswordLoading', false));
|
||||
},
|
||||
|
||||
showSecondFactorKey() {
|
||||
this.set('showSecondFactorKey', true);
|
||||
},
|
||||
|
@ -91,7 +91,7 @@
|
||||
{{text-field value=password
|
||||
id="password"
|
||||
type="password"
|
||||
classNames="input-large"
|
||||
classNames="input-xxlarge"
|
||||
autofocus="autofocus"}}
|
||||
</div>
|
||||
|
||||
@ -107,7 +107,12 @@
|
||||
disabled=loading
|
||||
label=submitButtonText}}
|
||||
|
||||
{{#if saved}}{{i18n 'saved'}}{{/if}}
|
||||
{{d-button action="resetPassword"
|
||||
class="btn"
|
||||
disabled=resetPasswordLoading
|
||||
label='user.change_password.action'}}
|
||||
|
||||
{{resetPasswordProgress}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -712,7 +712,7 @@ en:
|
||||
title: "Two Factor Authentication"
|
||||
enabled_status: "Status: On"
|
||||
disabled_status: "Status: Off"
|
||||
confirm_password_description: "Confirm your password to continue enabling Two Factor Authentication."
|
||||
confirm_password_description: "Confirm your password to continue enabling Two Factor Authentication"
|
||||
enable_description: |
|
||||
To complete Two Factor Authentication setup, scan the following QR code
|
||||
in one of the supported apps
|
||||
|
Loading…
x
Reference in New Issue
Block a user