{{#if showEnforcedNotice}}
{{i18n 'user.second_factor.enforced_notice'}}
{{/if}} {{#if errorMessage}}
{{errorMessage}}
{{/if}} {{#if model.second_factor_enabled}}
{{#second-factor-form secondFactorMethod=secondFactorMethod backupEnabled=backupEnabled secondFactorToken=secondFactorToken secondFactorTitle=(i18n 'user.second_factor.title') isLogin=false}} {{second-factor-input value=secondFactorToken inputId='second-factor-token' secondFactorMethod=secondFactorMethod}} {{/second-factor-form}}
{{d-button action=(action "disableSecondFactor") class="btn btn-primary" disabled=loading label=disableButtonText}} {{#unless showEnforcedNotice}} {{cancel-link route="preferences.account" args= model.username}} {{/unless}}
{{else}} {{#if loaded}}
{{{i18n 'user.second_factor.enable_description'}}} {{#if displayOAuthWarning}} {{i18n 'user.second_factor.oauth_enabled_warning'}} {{/if}}
{{{secondFactorImage}}}

{{#if showSecondFactorKey}} {{secondFactorKey}} {{else}} {{i18n 'user.second_factor.show_key_description'}} {{/if}}

{{second-factor-input maxlength=6 value=secondFactorToken inputId='second-factor-token'}}
{{d-button action=(action "enableSecondFactor") class="btn btn-primary" disabled=loading label=enableButtonText}} {{#unless showEnforcedNotice}} {{cancel-link route="preferences.account" args= model.username}} {{/unless}}
{{else}}
{{text-field value=password id="password" type="password" classNames="input-xxlarge" autofocus="autofocus"}}
{{i18n 'user.second_factor.confirm_password_description'}}
{{d-button action=(action "confirmPassword") class="btn btn-primary" disabled=loading label=submitButtonText}} {{d-button action=(action "resetPassword") class="btn" disabled=resetPasswordLoading icon="envelope" label='user.change_password.action'}} {{resetPasswordProgress}} {{#unless showEnforcedNotice}} {{cancel-link route="preferences.account" args= model.username}} {{/unless}}
{{/if}} {{/if}}