UX: Input for name when creating a new authenticator (#8153)

* FEATURE: Added input for name when creating a new authenticator in user preferences

* FEATURE: Added placeholders to authenticator inputs

* Ran prettier on second-factor-add-totp.js.es6
This commit is contained in:
Mark VanLandingham 2019-10-04 13:46:48 -05:00 committed by GitHub
parent 9e9d57d7ee
commit 30087beb72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 8 deletions

View File

@ -11,6 +11,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
this.setProperties({ this.setProperties({
errorMessage: null, errorMessage: null,
secondFactorKey: null, secondFactorKey: null,
secondFactorName: null,
secondFactorToken: null, secondFactorToken: null,
showSecondFactorKey: false, showSecondFactorKey: false,
secondFactorImage: null, secondFactorImage: null,
@ -47,10 +48,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
this.set("loading", true); this.set("loading", true);
this.model this.model
.enableSecondFactorTotp( .enableSecondFactorTotp(this.secondFactorToken, this.secondFactorName)
this.secondFactorToken,
I18n.t("user.second_factor.totp.default_name")
)
.then(response => { .then(response => {
if (response.error) { if (response.error) {
this.set("errorMessage", response.error); this.set("errorMessage", response.error);

View File

@ -6,4 +6,5 @@
id=inputId id=inputId
autocorrect="off" autocorrect="off"
autocapitalize="off" autocapitalize="off"
autofocus="autofocus"}} autofocus="autofocus"
placeholder=placeholder}}

View File

@ -33,10 +33,14 @@
</div> </div>
<div class="control-group"> <div class="control-group">
<label class="control-label input-prepend">{{i18n 'user.second_factor.label'}}</label> <label class="control-label input-prepend">{{i18n 'user.second_factor.name'}}</label>
<div class="controls"> <div class="controls">
{{second-factor-input maxlength=6 value=secondFactorToken inputId='second-factor-token'}} {{second-factor-input value=secondFactorName inputId='second-factor-name' placeholder=(i18n 'user.second_factor.totp.default_name')}}
</div>
<label class="control-label input-prepend">{{i18n 'user.second_factor.label'}}</label>
<div class="controls">
{{second-factor-input maxlength=6 value=secondFactorToken inputId='second-factor-token' placeholder='123456'}}
</div> </div>
</div> </div>

View File

@ -971,6 +971,7 @@ en:
enable: "Manage Two Factor Authentication" enable: "Manage Two Factor Authentication"
forgot_password: "Forgot password?" forgot_password: "Forgot password?"
confirm_password_description: "Please confirm your password to continue" confirm_password_description: "Please confirm your password to continue"
name: "Name"
label: "Code" label: "Code"
rate_limit: "Please wait before trying another authentication code." rate_limit: "Please wait before trying another authentication code."
enable_description: | enable_description: |