mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Specify pattern and maxlength for 2FA input fields.
This commit is contained in:
parent
7d7f6faf40
commit
a9699da672
@ -46,6 +46,8 @@
|
||||
</div>
|
||||
{{#second-factor-form}}
|
||||
{{text-field value=loginSecondFactor
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="login-second-factor"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
|
@ -34,7 +34,13 @@
|
||||
</table>
|
||||
</div>
|
||||
{{#second-factor-form}}
|
||||
{{text-field value=loginSecondFactor id="login-second-factor" autocorrect="off" autocapitalize="off" autofocus="autofocus"}}
|
||||
{{text-field value=loginSecondFactor
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="login-second-factor"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
autofocus="autofocus"}}
|
||||
{{/second-factor-form}}
|
||||
</form>
|
||||
{{/if}}
|
||||
|
@ -20,7 +20,9 @@
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
{{text-field value=second_factor_token
|
||||
id="second_factor_token"
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="second-factor-token"
|
||||
classNames="input-large"
|
||||
autofocus="autofocus"}}
|
||||
</div>
|
||||
@ -69,6 +71,8 @@
|
||||
|
||||
<div class="controls">
|
||||
{{text-field value=second_factor_token
|
||||
pattern='[0-9]{6}'
|
||||
maxlength='6'
|
||||
id="second-factor-token"
|
||||
classNames="input-large"
|
||||
autofocus="autofocus"}}
|
||||
|
@ -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) %></div>
|
||||
<div><%= text_field_tag(:second_factor_token, pattern: '[0-9]{6}', maxlength: 6) %></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) %><br><br>
|
||||
<%= text_field_tag(:second_factor_token, nil, autofocus: true, pattern: '[0-9]{6}', maxlength: 6) %><br><br>
|
||||
<%= submit_tag t('submit')%>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
Loading…
Reference in New Issue
Block a user