UX: Use 'tel' input type for 2FA token inputs.
This commit is contained in:
parent
8296f493ed
commit
70f14da732
|
@ -21,10 +21,10 @@ export default Ember.Controller.extend({
|
|||
},
|
||||
|
||||
toggleSecondFactor(enable) {
|
||||
if (!this.get('second_factor_token')) return;
|
||||
if (!this.get('secondFactorToken')) return;
|
||||
this.set('loading', true);
|
||||
|
||||
this.get('content').toggleSecondFactor(this.get('second_factor_token'), enable)
|
||||
this.get('content').toggleSecondFactor(this.get('secondFactorToken'), enable)
|
||||
.then(response => {
|
||||
if (response.error) {
|
||||
this.set('errorMessage', response.error);
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
{{text-field value=value
|
||||
type="tel"
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="login-second-factor"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
autofocus="autofocus"}}
|
|
@ -45,13 +45,7 @@
|
|||
</table>
|
||||
</div>
|
||||
{{#second-factor-form}}
|
||||
{{text-field value=loginSecondFactor
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="login-second-factor"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
autofocus="autofocus"}}
|
||||
{{second-factor-input value=loginSecondFactor}}
|
||||
{{/second-factor-form}}
|
||||
</form>
|
||||
{{/if}}
|
||||
|
|
|
@ -34,13 +34,7 @@
|
|||
</table>
|
||||
</div>
|
||||
{{#second-factor-form}}
|
||||
{{text-field value=loginSecondFactor
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="login-second-factor"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
autofocus="autofocus"}}
|
||||
{{second-factor-input value=loginSecondFactor}}
|
||||
{{/second-factor-form}}
|
||||
</form>
|
||||
{{/if}}
|
||||
|
|
|
@ -19,12 +19,7 @@
|
|||
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
{{text-field value=second_factor_token
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="second-factor-token"
|
||||
classNames="input-large"
|
||||
autofocus="autofocus"}}
|
||||
{{second-factor-input value=secondFactorToken}}
|
||||
</div>
|
||||
|
||||
<div class='instructions'>
|
||||
|
@ -70,12 +65,7 @@
|
|||
<label class="control-label input-prepend">{{i18n 'login.second_factor_label'}}</label>
|
||||
|
||||
<div class="controls">
|
||||
{{text-field value=second_factor_token
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="second-factor-token"
|
||||
classNames="input-large"
|
||||
autofocus="autofocus"}}
|
||||
{{second-factor-input value=secondFactorToken}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<%= text_field_tag(:second_factor_token, nil, autofocus: true, pattern: '[0-9]{6}', maxlength: 6, type: 'tel') %>
|
|
@ -10,7 +10,7 @@
|
|||
<%= form_tag(method: "post") do%>
|
||||
<h2><%=t "login.second_factor_title" %></h2>
|
||||
<%= label_tag(:second_factor_token, t("login.second_factor_description")) %>
|
||||
<div><%= text_field_tag(:second_factor_token, pattern: '[0-9]{6}', maxlength: 6) %></div>
|
||||
<div><%= render 'common/second_factor_text_field' %></div>
|
||||
<%= submit_tag(t("submit"), class: "btn btn-large btn-primary") %>
|
||||
<%end%>
|
||||
</div>
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
<% if @second_factor_required %>
|
||||
<%=form_tag({}, method: :put) do %>
|
||||
<%= label_tag(:second_factor_token, t('login.second_factor_description')) %>
|
||||
<%= text_field_tag(:second_factor_token, nil, autofocus: true, pattern: '[0-9]{6}', maxlength: 6) %><br><br>
|
||||
<%= render 'common/second_factor_text_field' %><br><br>
|
||||
<%= submit_tag t('submit')%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue