rodauth-rails 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +28 -0
  3. data/README.md +27 -17
  4. data/lib/generators/rodauth/install_generator.rb +1 -1
  5. data/lib/generators/rodauth/templates/app/views/rodauth/_email_auth_request_form.html.erb +7 -4
  6. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form.html.erb +26 -9
  7. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_footer.html.erb +7 -6
  8. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_header.html.erb +3 -3
  9. data/lib/generators/rodauth/templates/app/views/rodauth/add_recovery_codes.html.erb +7 -5
  10. data/lib/generators/rodauth/templates/app/views/rodauth/change_login.html.erb +29 -6
  11. data/lib/generators/rodauth/templates/app/views/rodauth/change_password.html.erb +29 -6
  12. data/lib/generators/rodauth/templates/app/views/rodauth/close_account.html.erb +15 -4
  13. data/lib/generators/rodauth/templates/app/views/rodauth/confirm_password.html.erb +13 -4
  14. data/lib/generators/rodauth/templates/app/views/rodauth/create_account.html.erb +37 -7
  15. data/lib/generators/rodauth/templates/app/views/rodauth/email_auth.html.erb +7 -3
  16. data/lib/generators/rodauth/templates/app/views/rodauth/login.html.erb +5 -3
  17. data/lib/generators/rodauth/templates/app/views/rodauth/logout.html.erb +16 -4
  18. data/lib/generators/rodauth/templates/app/views/rodauth/multi_phase_login.html.erb +5 -3
  19. data/lib/generators/rodauth/templates/app/views/rodauth/otp_auth.html.erb +17 -4
  20. data/lib/generators/rodauth/templates/app/views/rodauth/otp_disable.html.erb +15 -4
  21. data/lib/generators/rodauth/templates/app/views/rodauth/otp_setup.html.erb +30 -10
  22. data/lib/generators/rodauth/templates/app/views/rodauth/recovery_auth.html.erb +13 -4
  23. data/lib/generators/rodauth/templates/app/views/rodauth/recovery_codes.html.erb +15 -1
  24. data/lib/generators/rodauth/templates/app/views/rodauth/remember.html.erb +14 -9
  25. data/lib/generators/rodauth/templates/app/views/rodauth/reset_password.html.erb +21 -5
  26. data/lib/generators/rodauth/templates/app/views/rodauth/reset_password_request.html.erb +19 -9
  27. data/lib/generators/rodauth/templates/app/views/rodauth/sms_auth.html.erb +17 -4
  28. data/lib/generators/rodauth/templates/app/views/rodauth/sms_confirm.html.erb +17 -4
  29. data/lib/generators/rodauth/templates/app/views/rodauth/sms_disable.html.erb +15 -4
  30. data/lib/generators/rodauth/templates/app/views/rodauth/sms_request.html.erb +7 -3
  31. data/lib/generators/rodauth/templates/app/views/rodauth/sms_setup.html.erb +25 -5
  32. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_auth.html.erb +5 -3
  33. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_disable.html.erb +15 -4
  34. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_manage.html.erb +17 -15
  35. data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account.html.erb +17 -5
  36. data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account_request.html.erb +11 -5
  37. data/lib/generators/rodauth/templates/app/views/rodauth/verify_account.html.erb +23 -5
  38. data/lib/generators/rodauth/templates/app/views/rodauth/verify_account_resend.html.erb +19 -9
  39. data/lib/generators/rodauth/templates/app/views/rodauth/verify_login_change.html.erb +7 -3
  40. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_auth.html.erb +13 -9
  41. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_remove.html.erb +21 -9
  42. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_setup.html.erb +21 -9
  43. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/email_auth.text.erb +1 -1
  44. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/reset_password.text.erb +1 -1
  45. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/unlock_account.text.erb +1 -1
  46. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/verify_account.text.erb +1 -1
  47. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/verify_login_change.text.erb +3 -3
  48. data/lib/generators/rodauth/views_generator.rb +55 -93
  49. data/lib/rodauth/rails/app.rb +4 -0
  50. data/lib/rodauth/rails/feature/render.rb +1 -1
  51. data/lib/rodauth/rails/railtie.rb +4 -2
  52. data/lib/rodauth/rails/version.rb +1 -1
  53. data/lib/rodauth/rails.rb +8 -7
  54. metadata +2 -18
  55. data/lib/generators/rodauth/templates/app/views/rodauth/_field.html.erb +0 -10
  56. data/lib/generators/rodauth/templates/app/views/rodauth/_field_error.html.erb +0 -3
  57. data/lib/generators/rodauth/templates/app/views/rodauth/_global_logout_field.html.erb +0 -6
  58. data/lib/generators/rodauth/templates/app/views/rodauth/_login_confirm_field.html.erb +0 -4
  59. data/lib/generators/rodauth/templates/app/views/rodauth/_login_display.html.erb +0 -4
  60. data/lib/generators/rodauth/templates/app/views/rodauth/_login_field.html.erb +0 -4
  61. data/lib/generators/rodauth/templates/app/views/rodauth/_login_hidden_field.html.erb +0 -1
  62. data/lib/generators/rodauth/templates/app/views/rodauth/_new_password_field.html.erb +0 -4
  63. data/lib/generators/rodauth/templates/app/views/rodauth/_otp_auth_code_field.html.erb +0 -8
  64. data/lib/generators/rodauth/templates/app/views/rodauth/_password_confirm_field.html.erb +0 -4
  65. data/lib/generators/rodauth/templates/app/views/rodauth/_password_field.html.erb +0 -4
  66. data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_code_field.html.erb +0 -4
  67. data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_codes_form.html.erb +0 -6
  68. data/lib/generators/rodauth/templates/app/views/rodauth/_sms_code_field.html.erb +0 -8
  69. data/lib/generators/rodauth/templates/app/views/rodauth/_sms_phone_field.html.erb +0 -8
  70. data/lib/generators/rodauth/templates/app/views/rodauth/_submit.html.erb +0 -3
@@ -1,19 +1,24 @@
1
- <%%= form_tag <%= rodauth %>.remember_path, method: :post do %>
1
+ <% content_for :title, rodauth.remember_page_title %>
2
+
3
+ <%= form_with url: rodauth.remember_path, method: :post do |form| %>
2
4
  <fieldset class="form-group mb-3">
3
5
  <div class="form-check">
4
- <%%= radio_button_tag <%= rodauth %>.remember_param, <%= rodauth %>.remember_remember_param_value, false, id: "remember-remember", class: "form-check-input" %>
5
- <%%= label_tag "remember-remember", "Remember Me", class: "form-check-label" %>
6
+ <%= form.radio_button rodauth.remember_param, rodauth.remember_remember_param_value, id: "remember-remember", class: "form-check-input" %>
7
+ <%= form.label "remember-remember", rodauth.remember_remember_label, class: "form-check-label" %>
6
8
  </div>
7
9
 
8
10
  <div class="form-check">
9
- <%%= radio_button_tag <%= rodauth %>.remember_param, <%= rodauth %>.remember_forget_param_value, false, id: "remember-forget", class: "form-check-input" %>
10
- <%%= label_tag "remember-forget", "Forget Me", class: "form-check-label" %>
11
+ <%= form.radio_button rodauth.remember_param, rodauth.remember_forget_param_value, id: "remember-forget", class: "form-check-input" %>
12
+ <%= form.label "remember-forget", rodauth.remember_forget_label, class: "form-check-label" %>
11
13
  </div>
12
14
 
13
15
  <div class="form-check">
14
- <%%= radio_button_tag <%= rodauth %>.remember_param, <%= rodauth %>.remember_disable_param_value, false, id: "remember-disable", class: "form-check-input" %>
15
- <%%= label_tag "remember-disable", "Disable Remember Me", class: "form-check-label" %>
16
+ <%= form.radio_button rodauth.remember_param, rodauth.remember_disable_param_value, id: "remember-disable", class: "form-check-input" %>
17
+ <%= form.label "remember-disable", rodauth.remember_disable_label, class: "form-check-label" %>
16
18
  </div>
17
19
  </fieldset>
18
- <%%= render "submit", value: "Change Remember Setting" %>
19
- <%% end %>
20
+
21
+ <div class="form-group mb-3">
22
+ <%= form.submit rodauth.remember_button, class: "btn btn-primary" %>
23
+ </div>
24
+ <% end %>
@@ -1,5 +1,21 @@
1
- <%%= form_tag <%= rodauth %>.reset_password_path, method: :post do %>
2
- <%%= render "password_field" %>
3
- <%%= render "password_confirm_field" if <%= rodauth %>.require_password_confirmation? %>
4
- <%%= render "submit", value: "Reset Password" %>
5
- <%% end %>
1
+ <% content_for :title, rodauth.reset_password_page_title %>
2
+
3
+ <%= form_with url: rodauth.reset_password_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
6
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
7
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
8
+ </div>
9
+
10
+ <% if rodauth.require_password_confirmation? %>
11
+ <div class="form-group mb-3">
12
+ <%= form.label "password-confirm", rodauth.password_confirm_label, class: "form-label" %>
13
+ <%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_confirm_param)}", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
14
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "invalid-feedback", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
15
+ </div>
16
+ <% end %>
17
+
18
+ <div class="form-group mb-3">
19
+ <%= form.submit rodauth.reset_password_button, class: "btn btn-primary" %>
20
+ </div>
21
+ <% end %>
@@ -1,9 +1,19 @@
1
- <%%= form_tag <%= rodauth %>.reset_password_request_path, method: :post do %>
2
- <p>If you have forgotten your password, you can request a password reset:</p>
3
- <%% if params[<%= rodauth %>.login_param] && !<%= rodauth %>.field_error(<%= rodauth %>.login_param) %>
4
- <%%= render "login_hidden_field" %>
5
- <%% else %>
6
- <%%= render "login_field" %>
7
- <%% end %>
8
- <%%= render "submit", value: "Request Password Reset" %>
9
- <%% end %>
1
+ <% content_for :title, rodauth.reset_password_request_page_title %>
2
+
3
+ <%= form_with url: rodauth.reset_password_request_path, method: :post do |form| %>
4
+ <%== rodauth.reset_password_explanatory_text %>
5
+
6
+ <% if params[rodauth.login_param] && !rodauth.field_error(rodauth.login_param) %>
7
+ <%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
8
+ <% else %>
9
+ <div class="form-group mb-3">
10
+ <%= form.label "login", rodauth.login_label, class: "form-label" %>
11
+ <%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: "email", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.login_param)}", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
12
+ <%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "invalid-feedback", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <div class="form-group mb-3">
17
+ <%= form.submit rodauth.reset_password_request_button, class: "btn btn-primary" %>
18
+ </div>
19
+ <% end %>
@@ -1,4 +1,17 @@
1
- <%%= form_tag <%= rodauth %>.sms_auth_path, method: :post do %>
2
- <%%= render "sms_code_field" %>
3
- <%%= render "submit", value: "Authenticate via SMS Code" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.sms_auth_page_title %>
2
+
3
+ <%= form_with url: rodauth.sms_auth_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.label "sms-code", rodauth.sms_code_label, class: "form-label" %>
6
+ <div class="row">
7
+ <div class="col-sm-3">
8
+ <%= form.text_field rodauth.sms_code_param, value: "", id: "sms-code", autocomplete: "one-time-code", inputmode: "numeric", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.sms_code_param)}", aria: ({ invalid: true, describedby: "sms-code_error_message" } if rodauth.field_error(rodauth.sms_code_param)) %>
9
+ <%= content_tag(:span, rodauth.field_error(rodauth.sms_code_param), class: "invalid-feedback", id: "sms-code_error_message") if rodauth.field_error(rodauth.sms_code_param) %>
10
+ </div>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="form-group mb-3">
15
+ <%= form.submit rodauth.sms_auth_button, class: "btn btn-primary" %>
16
+ </div>
17
+ <% end %>
@@ -1,4 +1,17 @@
1
- <%%= form_tag <%= rodauth %>.sms_confirm_path, method: :post do %>
2
- <%%= render "sms_code_field" %>
3
- <%%= render "submit", value: "Confirm SMS Backup Number" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.sms_confirm_page_title %>
2
+
3
+ <%= form_with url: rodauth.sms_confirm_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.label "sms-code", rodauth.sms_code_label, class: "form-label" %>
6
+ <div class="row">
7
+ <div class="col-sm-3">
8
+ <%= form.text_field rodauth.sms_code_param, value: "", id: "sms-code", autocomplete: "one-time-code", inputmode: "numeric", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.sms_code_param)}", aria: ({ invalid: true, describedby: "sms-code_error_message" } if rodauth.field_error(rodauth.sms_code_param)) %>
9
+ <%= content_tag(:span, rodauth.field_error(rodauth.sms_code_param), class: "invalid-feedback", id: "sms-code_error_message") if rodauth.field_error(rodauth.sms_code_param) %>
10
+ </div>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="form-group mb-3">
15
+ <%= form.submit rodauth.sms_confirm_button, class: "btn btn-primary" %>
16
+ </div>
17
+ <% end %>
@@ -1,4 +1,15 @@
1
- <%%= form_tag <%= rodauth %>.sms_disable_path, method: :post do %>
2
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
- <%%= render "submit", value: "Disable Backup SMS Authentication" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.sms_disable_page_title %>
2
+
3
+ <%= form_with url: rodauth.sms_disable_path, method: :post do |form| %>
4
+ <% if rodauth.two_factor_modifications_require_password? %>
5
+ <div class="form-group mb-3">
6
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
7
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
8
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
9
+ </div>
10
+ <% end %>
11
+
12
+ <div class="form-group mb-3">
13
+ <%= form.submit rodauth.sms_disable_button, class: "btn btn-primary" %>
14
+ </div>
15
+ <% end %>
@@ -1,3 +1,7 @@
1
- <%%= form_tag <%= rodauth %>.sms_request_path, method: :post do %>
2
- <%%= render "submit", value: "Send SMS Code" %>
3
- <%% end %>
1
+ <% content_for :title, rodauth.sms_request_page_title %>
2
+
3
+ <%= form_with url: rodauth.sms_request_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.submit rodauth.sms_request_button, class: "btn btn-primary" %>
6
+ </div>
7
+ <% end %>
@@ -1,5 +1,25 @@
1
- <%%= form_tag <%= rodauth %>.sms_setup_path, method: :post do %>
2
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
- <%%= render "sms_phone_field" %>
4
- <%%= render "submit", value: "Setup SMS Backup Number" %>
5
- <%% end %>
1
+ <% content_for :title, rodauth.sms_setup_page_title %>
2
+
3
+ <%= form_with url: rodauth.sms_setup_path, method: :post do |form| %>
4
+ <% if rodauth.two_factor_modifications_require_password? %>
5
+ <div class="form-group mb-3">
6
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
7
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
8
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
9
+ </div>
10
+ <% end %>
11
+
12
+ <div class="form-group mb-3">
13
+ <%= form.label "sms-phone", rodauth.sms_phone_label, class: "form-label" %>
14
+ <div class="row">
15
+ <div class="col-sm-3">
16
+ <%= form.telephone_field rodauth.sms_phone_param, value: "", id: "sms-phone", autocomplete: "tel", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.sms_phone_param)}", aria: ({ invalid: true, describedby: "sms-phone_error_message" } if rodauth.field_error(rodauth.sms_phone_param)) %>
17
+ <%= content_tag(:span, rodauth.field_error(rodauth.sms_phone_param), class: "invalid-feedback", id: "sms-phone_error_message") if rodauth.field_error(rodauth.sms_phone_param) %>
18
+ </div>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="form-group mb-3">
23
+ <%= form.submit rodauth.sms_setup_button, class: "btn btn-primary" %>
24
+ </div>
25
+ <% end %>
@@ -1,5 +1,7 @@
1
+ <% content_for :title, rodauth.two_factor_auth_page_title %>
2
+
1
3
  <ul>
2
- <%% <%= rodauth %>.two_factor_auth_links.sort.each do |_, link, text| %>
3
- <li><%%= link_to text, link %></li>
4
- <%% end %>
4
+ <% rodauth.two_factor_auth_links.sort.each do |_, link, text| %>
5
+ <li><%= link_to text, link %></li>
6
+ <% end %>
5
7
  </ul>
@@ -1,4 +1,15 @@
1
- <%%= form_tag <%= rodauth %>.two_factor_disable_path, method: :post do %>
2
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
- <%%= render "submit", value: "Remove All Multifactor Authentication Methods" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.two_factor_disable_page_title %>
2
+
3
+ <%= form_with url: rodauth.two_factor_disable_path, method: :post do |form| %>
4
+ <% if rodauth.two_factor_modifications_require_password? %>
5
+ <div class="form-group mb-3">
6
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
7
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
8
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
9
+ </div>
10
+ <% end %>
11
+
12
+ <div class="form-group mb-3">
13
+ <%= form.submit rodauth.two_factor_disable_button, class: "btn btn-primary" %>
14
+ </div>
15
+ <% end %>
@@ -1,22 +1,24 @@
1
- <%% if <%= rodauth %>.two_factor_setup_links.any? %>
2
- <h2>Setup Multifactor Authentication</h2>
1
+ <% content_for :title, rodauth.two_factor_manage_page_title %>
2
+
3
+ <% if rodauth.two_factor_setup_links.any? %>
4
+ <%== rodauth.two_factor_setup_heading %>
3
5
 
4
6
  <ul>
5
- <%% <%= rodauth %>.two_factor_setup_links.sort.each do |_, link, text| %>
6
- <li><%%= link_to text, link %></li>
7
- <%% end %>
7
+ <% rodauth.two_factor_setup_links.sort.each do |_, link, text| %>
8
+ <li><%= link_to text, link %></li>
9
+ <% end %>
8
10
  </ul>
9
- <%% end %>
11
+ <% end %>
10
12
 
11
- <%% if <%= rodauth %>.two_factor_remove_links.any? %>
12
- <h2>Remove Multifactor Authentication</h2>
13
+ <% if rodauth.two_factor_remove_links.any? %>
14
+ <%== rodauth.two_factor_remove_heading %>
13
15
 
14
16
  <ul>
15
- <%% <%= rodauth %>.two_factor_remove_links.sort.each do |_, link, text| %>
16
- <li><%%= link_to text, link %></li>
17
- <%% end %>
18
- <%% if <%= rodauth %>.two_factor_remove_links.length > 1 %>
19
- <li><%%= link_to "Remove All Multifactor Authentication Methods", <%= rodauth %>.two_factor_disable_path %></li>
20
- <%% end %>
17
+ <% rodauth.two_factor_remove_links.sort.each do |_, link, text| %>
18
+ <li><%= link_to text, link %></li>
19
+ <% end %>
20
+ <% if rodauth.two_factor_remove_links.length > 1 %>
21
+ <li><%= link_to rodauth.two_factor_disable_link_text, rodauth.two_factor_disable_path %></li>
22
+ <% end %>
21
23
  </ul>
22
- <%% end %>
24
+ <% end %>
@@ -1,5 +1,17 @@
1
- <%%= form_tag <%= rodauth %>.unlock_account_path, method: :post do %>
2
- <p>This account is currently locked out. You can unlock the account:</p>
3
- <%%= render "password_field" if <%= rodauth %>.unlock_account_requires_password? %>
4
- <%%= render "submit", value: "Unlock Account" %>
5
- <%% end %>
1
+ <% content_for :title, rodauth.unlock_account_page_title %>
2
+
3
+ <%= form_with url: rodauth.unlock_account_path, method: :post do |form| %>
4
+ <%== rodauth.unlock_account_explanatory_text %>
5
+
6
+ <% if rodauth.unlock_account_requires_password? %>
7
+ <div class="form-group mb-3">
8
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
9
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
10
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="form-group mb-3">
15
+ <%= form.submit rodauth.unlock_account_button, class: "btn btn-primary" %>
16
+ </div>
17
+ <% end %>
@@ -1,5 +1,11 @@
1
- <%%= form_tag <%= rodauth %>.unlock_account_request_path, method: :post do %>
2
- <p>This account is currently locked out. You can request that the account be unlocked:</p>
3
- <%%= render "login_hidden_field" %>
4
- <%%= render "submit", value: "Request Account Unlock" %>
5
- <%% end %>
1
+ <% content_for :title, rodauth.unlock_account_request_page_title %>
2
+
3
+ <%= form_with url: rodauth.unlock_account_request_path, method: :post do |form| %>
4
+ <%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
5
+
6
+ <%== rodauth.unlock_account_request_explanatory_text %>
7
+
8
+ <div class="form-group mb-3">
9
+ <%= form.submit rodauth.unlock_account_request_button, class: "btn btn-primary" %>
10
+ </div>
11
+ <% end %>
@@ -1,5 +1,23 @@
1
- <%%= form_tag <%= rodauth %>.verify_account_path, method: :post do %>
2
- <%%= render "password_field" if <%= rodauth %>.verify_account_set_password? %>
3
- <%%= render "password_confirm_field" if <%= rodauth %>.verify_account_set_password? && <%= rodauth %>.require_password_confirmation? %>
4
- <%%= render "submit", value: "Verify Account" %>
5
- <%% end %>
1
+ <% content_for :title, rodauth.verify_account_page_title %>
2
+
3
+ <%= form_with url: rodauth.verify_account_path, method: :post do |form| %>
4
+ <% if rodauth.verify_account_set_password? %>
5
+ <div class="form-group mb-3">
6
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
7
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
8
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
9
+ </div>
10
+
11
+ <% if rodauth.require_password_confirmation? %>
12
+ <div class="form-group mb-3">
13
+ <%= form.label "password-confirm", rodauth.password_confirm_label, class: "form-label" %>
14
+ <%= form.password_field rodauth.password_confirm_param, value: "", id: "password-confirm", autocomplete: "new-password", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_confirm_param)}", aria: ({ invalid: true, describedby: "password-confirm_error_message" } if rodauth.field_error(rodauth.password_confirm_param)) %>
15
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_confirm_param), class: "invalid-feedback", id: "password-confirm_error_message") if rodauth.field_error(rodauth.password_confirm_param) %>
16
+ </div>
17
+ <% end %>
18
+ <% end %>
19
+
20
+ <div class="form-group mb-3">
21
+ <%= form.submit rodauth.verify_account_button, class: "btn btn-primary" %>
22
+ </div>
23
+ <% end %>
@@ -1,9 +1,19 @@
1
- <%%= form_tag <%= rodauth %>.verify_account_resend_path, method: :post do %>
2
- <p>If you no longer have the email to verify the account, you can request that it be resent to you:</p>
3
- <%% if params[<%= rodauth %>.login_param] %>
4
- <%%= render "login_hidden_field" %>
5
- <%% else %>
6
- <%%= render "login_field" %>
7
- <%% end %>
8
- <%%= render "submit", value: "Send Verification Login Again" %>
9
- <%% end %>
1
+ <% content_for :title, rodauth.resend_verify_account_page_title %>
2
+
3
+ <%= form_with url: rodauth.verify_account_resend_path, method: :post do |form| %>
4
+ <%== rodauth.verify_account_resend_explanatory_text %>
5
+
6
+ <% if params[rodauth.login_param] %>
7
+ <%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
8
+ <% else %>
9
+ <div class="form-group mb-3">
10
+ <%= form.label "login", rodauth.login_label, class: "form-label" %>
11
+ <%= form.email_field rodauth.login_param, value: params[rodauth.login_param], id: "login", autocomplete: "email", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.login_param)}", aria: ({ invalid: true, describedby: "login_error_message" } if rodauth.field_error(rodauth.login_param)) %>
12
+ <%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "invalid-feedback", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <div class="form-group mb-3">
17
+ <%= form.submit rodauth.verify_account_resend_button, class: "btn btn-primary" %>
18
+ </div>
19
+ <% end %>
@@ -1,3 +1,7 @@
1
- <%%= form_tag <%= rodauth %>.verify_login_change_path, method: :post do %>
2
- <%%= render "submit", value: "Verify Login Change" %>
3
- <%% end %>
1
+ <% content_for :title, rodauth.verify_login_change_page_title %>
2
+
3
+ <%= form_with url: rodauth.verify_login_change_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.submit rodauth.verify_login_change_button, class: "btn btn-primary" %>
6
+ </div>
7
+ <% end %>
@@ -1,13 +1,17 @@
1
- <%% cred = <%= rodauth %>.webauth_credential_options_for_get %>
1
+ <% content_for :title, rodauth.webauthn_auth_page_title %>
2
2
 
3
- <%%= form_tag <%= rodauth %>.webauthn_auth_form_path, method: :post, id: "webauthn-auth-form", data: { credential_options: cred.as_json.to_json } do %>
4
- <%%= render "login_hidden_field" if params[<%= rodauth %>.login_param] %>
5
- <%%= hidden_field_tag <%= rodauth %>.webauthn_auth_challenge_param, cred.challenge %>
6
- <%%= hidden_field_tag <%= rodauth %>.webauthn_auth_challenge_hmac_param, <%= rodauth %>.compute_hmac(cred.challenge) %>
7
- <%%= text_field_tag <%= rodauth %>.webauthn_auth_param, "", id: "webauthn-auth", aria: { hidden: "true" } %>
3
+ <% cred = rodauth.webauth_credential_options_for_get %>
4
+
5
+ <%= form_with url: rodauth.webauthn_auth_form_path, method: :post, id: "webauthn-auth-form", data: { credential_options: cred.as_json.to_json } do |form| %>
6
+ <%= form.hidden_field rodauth.login_param, value: params[rodauth.login_param] %>
7
+ <%= form.hidden_field rodauth.webauthn_auth_challenge_param, value: cred.challenge %>
8
+ <%= form.hidden_field rodauth.webauthn_auth_challenge_hmac_param, value: rodauth.compute_hmac(cred.challenge) %>
9
+ <%= form.text_field rodauth.webauthn_auth_param, value: "", id: "webauthn-auth", aria: { hidden: "true" } %>
8
10
  <div id="webauthn-auth-button">
9
- <%%= render "submit", value: "Authenticate Using WebAuthn" %>
11
+ <div class="form-group mb-3">
12
+ <%= form.submit rodauth.webauthn_auth_button, class: "btn btn-primary" %>
13
+ </div>
10
14
  </div>
11
- <%% end %>
15
+ <% end %>
12
16
 
13
- <%%= javascript_include_tag <%= rodauth %>.webauthn_auth_js_path %>
17
+ <%= javascript_include_tag rodauth.webauthn_auth_js_path %>
@@ -1,13 +1,25 @@
1
- <%%= form_tag <%= rodauth %>.webauthn_remove_path, method: :post, id: "webauthn-remove-form" do %>
2
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
1
+ <% content_for :title, rodauth.webauthn_remove_page_title %>
2
+
3
+ <%= form_with url: rodauth.webauthn_remove_path, method: :post, id: "webauthn-remove-form" do |form| %>
4
+ <% if rodauth.two_factor_modifications_require_password? %>
5
+ <div class="form-group mb-3">
6
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
7
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
8
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
9
+ </div>
10
+ <% end %>
11
+
3
12
  <fieldset class="form-group mb-3">
4
- <%% (usage = <%= rodauth %>.account_webauthn_usage).each do |id, last_use| %>
13
+ <% (usage = rodauth.account_webauthn_usage).each do |id, last_use| %>
5
14
  <div class="form-check">
6
- <%%= render "field", name: <%= rodauth %>.webauthn_remove_param, id: "webauthn-remove-#{id}", type: :radio, class: "form-check-input", skip_error_message: true, value: id, required: false %>
7
- <%%= label_tag "webauthn-remove-#{id}", "Last use: #{last_use}", class: "form-check-label" %>
8
- <%%= render "field_error", name: <%= rodauth %>.webauthn_remove_param if id == usage.keys.last %>
15
+ <%= form.radio_button rodauth.webauthn_remove_param, id, id: "webauthn-remove-#{id}", class: "form-check-input #{"is-invalid" if rodauth.field_error(rodauth.webauthn_remove_param)}", aria: ({ invalid: true, describedby: "webauthn_remove_error_message" } if rodauth.field_error(rodauth.webauthn_remove_param)) %>
16
+ <%= form.label "webauthn-remove-#{id}", "Last use: #{last_use}", class: "form-check-label" %>
17
+ <%= content_tag(:span, rodauth.field_error(rodauth.webauthn_remove_param), class: "invalid-feedback", id: "webauthn_remove_error_message") if rodauth.field_error(rodauth.webauthn_remove_param) && id == usage.keys.last %>
9
18
  </div>
10
- <%% end %>
19
+ <% end %>
11
20
  </fieldset>
12
- <%%= render "submit", value: "Remove WebAuthn Authenticator" %>
13
- <%% end %>
21
+
22
+ <div class="form-group mb-3">
23
+ <%= form.submit rodauth.webauthn_remove_button, class: "btn btn-primary" %>
24
+ </div>
25
+ <% end %>
@@ -1,13 +1,25 @@
1
- <%% cred = <%= rodauth %>.new_webauthn_credential %>
1
+ <% content_for :title, rodauth.webauthn_setup_page_title %>
2
+
3
+ <% cred = rodauth.new_webauthn_credential %>
4
+
5
+ <%= form_with url: rodauth.webauthn_setup_path, method: :post, id: "webauthn-setup-form", data: { credential_options: cred.as_json.to_json } do |form| %>
6
+ <%= form.hidden_field rodauth.webauthn_setup_challenge_param, value: cred.challenge %>
7
+ <%= form.hidden_field rodauth.webauthn_setup_challenge_hmac_param, value: rodauth.compute_hmac(cred.challenge) %>
8
+ <%= form.text_field rodauth.webauthn_setup_param, value: "", id: "webauthn-setup", aria: { hidden: "true" } %>
9
+
10
+ <% if rodauth.two_factor_modifications_require_password? %>
11
+ <div class="form-group mb-3">
12
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
13
+ <%= form.password_field rodauth.password_param, value: "", id: "password", autocomplete: rodauth.password_field_autocomplete_value, required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.password_param)}", aria: ({ invalid: true, describedby: "password_error_message" } if rodauth.field_error(rodauth.password_param)) %>
14
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
15
+ </div>
16
+ <% end %>
2
17
 
3
- <%%= form_tag <%= rodauth %>.webauthn_setup_path, method: :post, id: "webauthn-setup-form", data: { credential_options: cred.as_json.to_json } do %>
4
- <%%= hidden_field_tag <%= rodauth %>.webauthn_setup_challenge_param, cred.challenge %>
5
- <%%= hidden_field_tag <%= rodauth %>.webauthn_setup_challenge_hmac_param, <%= rodauth %>.compute_hmac(cred.challenge) %>
6
- <%%= text_field_tag <%= rodauth %>.webauthn_setup_param, "", id: "webauthn-setup", aria: { hidden: "true" } %>
7
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
8
18
  <div id="webauthn-setup-button">
9
- <%%= render "submit", value: "Setup WebAuthn Authentication" %>
19
+ <div class="form-group mb-3">
20
+ <%= form.submit rodauth.webauthn_setup_button, class: "btn btn-primary" %>
21
+ </div>
10
22
  </div>
11
- <%% end %>
23
+ <% end %>
12
24
 
13
- <%%= javascript_include_tag <%= rodauth %>.webauthn_setup_js_path %>
25
+ <%= javascript_include_tag rodauth.webauthn_setup_js_path %>
@@ -1,5 +1,5 @@
1
1
  Someone has requested a login link for the account with this email
2
2
  address. If you did not request a login link, please ignore this
3
3
  message. If you requested a login link, please go to
4
- <%%= @email_link %>
4
+ <%= @email_link %>
5
5
  to login to this account.
@@ -1,5 +1,5 @@
1
1
  Someone has requested a password reset for the account with this email
2
2
  address. If you did not request a password reset, please ignore this
3
3
  message. If you requested a password reset, please go to
4
- <%%= @email_link %>
4
+ <%= @email_link %>
5
5
  to reset the password for the account.
@@ -1,5 +1,5 @@
1
1
  Someone has requested that the account with this email be unlocked.
2
2
  If you did not request the unlocking of this account, please ignore this
3
3
  message. If you requested the unlocking of this account, please go to
4
- <%%= @email_link %>
4
+ <%= @email_link %>
5
5
  to unlock this account.
@@ -1,4 +1,4 @@
1
1
  Someone has created an account with this email address. If you did not create
2
2
  this account, please ignore this message. If you created this account, please go to
3
- <%%= @email_link %>
3
+ <%= @email_link %>
4
4
  to verify the account.
@@ -1,10 +1,10 @@
1
1
  Someone with an account has requested their login be changed to this email address:
2
2
 
3
- Old email: <%%= @old_login %>
3
+ Old email: <%= @old_login %>
4
4
 
5
- New email: <%%= @new_login %>
5
+ New email: <%= @new_login %>
6
6
 
7
7
  If you did not request this login change, please ignore this message. If you
8
8
  requested this login change, please go to
9
- <%%= @email_link %>
9
+ <%= @email_link %>
10
10
  to verify the login change.