Skip to content

Commit a241c06

Browse files
authored
Merge pull request #1583 from codidact/art/1575/two-factor-field
Use numeric inputs for two-factor codes
2 parents 03b0352 + f67b12a commit a241c06

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

app/views/layouts/_head.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<meta charset="utf-8" />
22
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
33
<meta name="viewport" content="width=device-width, initial-scale=1" />
4-
<% desc = "#{SiteSetting['SiteName']} on Codidact - open, community-run Q&A knowledge sharing" %>
4+
<% desc = "#{SiteSetting['SiteName']} on #{ENV.fetch('NETWORK_NAME', 'Codidact')} - open, community-run Q&A knowledge sharing" %>
55
<meta name="description" content="<%= content_for?(:description) ? content_for(:description) : desc %>" />
66

77
<% page_title = (Rails.env.development? ? '[DEV] ' : '') +

app/views/two_factor/disable_code.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
<%= form_tag two_factor_confirm_disable_path do %>
66
<div class="form-group">
77
<%= label_tag 'code', 'Code', class: 'form-element' %>
8-
<%= text_field_tag 'code', '', class: 'form-element' %>
8+
<%= number_field_tag 'code', '', class: 'form-element', autocomplete: 'one-time-code', autofocus: 'true',
9+
inputmode: 'numeric' %>
910
</div>
1011

1112
<%= submit_tag 'Confirm', class: 'button is-filled' %>

app/views/two_factor/enable_code.html.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
<%= form_tag two_factor_confirm_enable_path, autocomplete: 'off' do %>
1616
<div class="field">
1717
<%= label_tag 'code', 'Code', class: 'form-element' %>
18-
<%= number_field_tag 'code', '', class: 'form-element', autocomplete: 'one-time-code' %>
18+
<%= number_field_tag 'code', '', class: 'form-element', autocomplete: 'one-time-code', autofocus: 'true',
19+
inputmode: 'numeric' %>
1920
</div>
2021

2122
<%= submit_tag 'Confirm', class: 'button is-filled' %>

app/views/users/sessions/verify_2fa.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<div class="form-group">
1111
<%= label_tag 'code', 'Code', class: 'form-element' %>
12-
<%= text_field_tag 'code', '', class: 'form-element', autocomplete: 'one-time-code', autofocus: 'true' %>
12+
<%= number_field_tag 'code', '', class: 'form-element', autocomplete: 'one-time-code', autofocus: 'true', inputmode: 'numeric' %>
1313
</div>
1414

1515
<div class="actions">

0 commit comments

Comments
 (0)