- {{d-button
- class="btn-primary"
- type="submit"
- action=(action "confirmPassword")
- disabled=loading
- label="continue"}}
+ {{#if errorMessage}}
+
+ {{/if}}
+ {{#if loaded}}
+
+
+
{{i18n "user.second_factor.totp.title"}}
+ {{d-button action=(action "createTotp")
+ class="btn-primary new-totp"
+ icon="plus"
+ disabled=loading
+ label="user.second_factor.totp.add"}}
+ {{#each totps as |totp|}}
+
+ {{#if totp.name}}
+ {{totp.name}}
+ {{else}}
+ {{i18n "user.second_factor.totp.default_name"}}
+ {{/if}}
+
+ {{#if isCurrentUser}}
+ {{d-button action=(action "editSecondFactor" totp)
+ class="btn-default btn-small btn-icon pad-left no-text edit"
+ disabled=loading
+ icon="pencil-alt"
+ aria-label="user.second_factor.edit"
+ title="user.second_factor.edit"
+ }}
+ {{/if}}
+
+ {{/each}}
+
+
+
+
+
+
{{i18n "user.second_factor.security_key.title"}}
+ {{d-button action=(action "createSecurityKey")
+ class="btn-primary new-security-key"
+ icon="plus"
+ disabled=loading
+ label="user.second_factor.security_key.add"}}
+ {{#each security_keys as |security_key|}}
+
+ {{#if security_key.name}}
+ {{security_key.name}}
+ {{else}}
+ {{i18n "user.second_factor.security_key.default_name"}}
+ {{/if}}
+
+ {{#if isCurrentUser}}
+ {{d-button action=(action "editSecurityKey" security_key)
+ class="btn-default btn-small btn-icon pad-left no-text edit"
+ disabled=loading
+ icon="pencil-alt"
+ aria-label="user.second_factor.edit"
+ title="user.second_factor.edit"
+ }}
+ {{/if}}
+
+ {{/each}}
+
+
+
+
+
+
{{i18n "user.second_factor_backup.title"}}
+ {{#if model.second_factor_enabled}}
+ {{#if model.second_factor_backup_enabled}}
+ {{html-safe (i18n "user.second_factor_backup.manage" count=model.second_factor_remaining_backup_codes)}}
+ {{else}}
+ {{i18n "user.second_factor_backup.enable_long"}}
+ {{/if}}
+
+ {{#if isCurrentUser}}
+ {{d-button action=(action "editSecondFactorBackup")
+ class="btn-default btn-small btn-icon pad-left no-text edit edit-2fa-backup"
+ disabled=loading
+ icon="pencil-alt"
+ aria-label="user.second_factor.edit"
+ title="user.second_factor.edit"
+ }}
+ {{/if}}
+ {{else}}
+ {{i18n "user.second_factor_backup.enable_prerequisites"}}
+ {{/if}}
+
+
+
+ {{#if model.second_factor_enabled}}
{{#unless showEnforcedNotice}}
- {{cancel-link route="preferences.account" args=model.username}}
+
+
+ {{d-button
+ class="btn-danger"
+ icon="ban"
+ action=(action "disableAllSecondFactors")
+ disabled=loading
+ label="user.second_factor.disable_all"}}
+
+
{{/unless}}
+ {{/if}}
+ {{else}}
+
+
+
+
+
+ {{text-field value=password
+ id="password"
+ type="password"
+ classNames="input-large"
+ autofocus="autofocus"}}
+
+
+ {{i18n "user.second_factor.confirm_password_description"}}
+
+
-
- {{resetPasswordProgress}}
- {{#unless resetPasswordLoading}}
-
{{ i18n "user.second_factor.forgot_password" }}
- {{/unless}}
+
+
+
+ {{d-button
+ class="btn-primary"
+ type="submit"
+ action=(action "confirmPassword")
+ disabled=loading
+ label="continue"}}
+
+ {{#unless showEnforcedNotice}}
+ {{cancel-link route="preferences.account" args=model.username}}
+ {{/unless}}
+
+
-
- {{/if}}
-
- {{/conditional-loading-spinner}}
-
+ {{/if}}
+
+ {{/conditional-loading-spinner}}
+
+{{/d-section}}
diff --git a/app/assets/javascripts/discourse/app/templates/preferences-username.hbs b/app/assets/javascripts/discourse/app/templates/preferences-username.hbs
index c16dfddb896..6f0f758028f 100644
--- a/app/assets/javascripts/discourse/app/templates/preferences-username.hbs
+++ b/app/assets/javascripts/discourse/app/templates/preferences-username.hbs
@@ -1,39 +1,41 @@
-