rodauth-rails 0.15.0 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +62 -0
  3. data/README.md +114 -53
  4. data/lib/generators/rodauth/install_generator.rb +11 -3
  5. data/lib/generators/rodauth/migration/base.erb +8 -2
  6. data/lib/generators/rodauth/templates/app/views/rodauth/_email_auth_request_form.html.erb +7 -4
  7. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form.html.erb +26 -9
  8. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_footer.html.erb +7 -6
  9. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_header.html.erb +3 -3
  10. data/lib/generators/rodauth/templates/app/views/rodauth/add_recovery_codes.html.erb +7 -5
  11. data/lib/generators/rodauth/templates/app/views/rodauth/change_login.html.erb +29 -6
  12. data/lib/generators/rodauth/templates/app/views/rodauth/change_password.html.erb +29 -6
  13. data/lib/generators/rodauth/templates/app/views/rodauth/close_account.html.erb +15 -4
  14. data/lib/generators/rodauth/templates/app/views/rodauth/confirm_password.html.erb +13 -4
  15. data/lib/generators/rodauth/templates/app/views/rodauth/create_account.html.erb +37 -7
  16. data/lib/generators/rodauth/templates/app/views/rodauth/email_auth.html.erb +7 -3
  17. data/lib/generators/rodauth/templates/app/views/rodauth/login.html.erb +5 -3
  18. data/lib/generators/rodauth/templates/app/views/rodauth/logout.html.erb +16 -4
  19. data/lib/generators/rodauth/templates/app/views/rodauth/multi_phase_login.html.erb +5 -3
  20. data/lib/generators/rodauth/templates/app/views/rodauth/otp_auth.html.erb +17 -4
  21. data/lib/generators/rodauth/templates/app/views/rodauth/otp_disable.html.erb +15 -4
  22. data/lib/generators/rodauth/templates/app/views/rodauth/otp_setup.html.erb +30 -10
  23. data/lib/generators/rodauth/templates/app/views/rodauth/recovery_auth.html.erb +13 -4
  24. data/lib/generators/rodauth/templates/app/views/rodauth/recovery_codes.html.erb +15 -1
  25. data/lib/generators/rodauth/templates/app/views/rodauth/remember.html.erb +14 -9
  26. data/lib/generators/rodauth/templates/app/views/rodauth/reset_password.html.erb +21 -5
  27. data/lib/generators/rodauth/templates/app/views/rodauth/reset_password_request.html.erb +19 -9
  28. data/lib/generators/rodauth/templates/app/views/rodauth/sms_auth.html.erb +17 -4
  29. data/lib/generators/rodauth/templates/app/views/rodauth/sms_confirm.html.erb +17 -4
  30. data/lib/generators/rodauth/templates/app/views/rodauth/sms_disable.html.erb +15 -4
  31. data/lib/generators/rodauth/templates/app/views/rodauth/sms_request.html.erb +7 -3
  32. data/lib/generators/rodauth/templates/app/views/rodauth/sms_setup.html.erb +25 -5
  33. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_auth.html.erb +5 -3
  34. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_disable.html.erb +15 -4
  35. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_manage.html.erb +17 -15
  36. data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account.html.erb +17 -5
  37. data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account_request.html.erb +11 -5
  38. data/lib/generators/rodauth/templates/app/views/rodauth/verify_account.html.erb +23 -5
  39. data/lib/generators/rodauth/templates/app/views/rodauth/verify_account_resend.html.erb +19 -9
  40. data/lib/generators/rodauth/templates/app/views/rodauth/verify_login_change.html.erb +7 -3
  41. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_auth.html.erb +13 -9
  42. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_remove.html.erb +21 -9
  43. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_setup.html.erb +21 -9
  44. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/email_auth.text.erb +1 -1
  45. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/reset_password.text.erb +1 -1
  46. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/unlock_account.text.erb +1 -1
  47. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/verify_account.text.erb +1 -1
  48. data/lib/generators/rodauth/templates/app/views/rodauth_mailer/verify_login_change.text.erb +3 -3
  49. data/lib/generators/rodauth/views_generator.rb +55 -90
  50. data/lib/rodauth/rails/app.rb +4 -0
  51. data/lib/rodauth/rails/auth.rb +2 -2
  52. data/lib/rodauth/rails/controller_methods.rb +42 -1
  53. data/lib/rodauth/rails/feature/base.rb +9 -0
  54. data/lib/rodauth/rails/feature/csrf.rb +15 -4
  55. data/lib/rodauth/rails/feature/internal_request.rb +16 -20
  56. data/lib/rodauth/rails/feature/render.rb +1 -1
  57. data/lib/rodauth/rails/model.rb +1 -1
  58. data/lib/rodauth/rails/railtie.rb +4 -2
  59. data/lib/rodauth/rails/version.rb +1 -1
  60. data/lib/rodauth/rails.rb +15 -10
  61. metadata +2 -18
  62. data/lib/generators/rodauth/templates/app/views/rodauth/_field.html.erb +0 -10
  63. data/lib/generators/rodauth/templates/app/views/rodauth/_field_error.html.erb +0 -3
  64. data/lib/generators/rodauth/templates/app/views/rodauth/_global_logout_field.html.erb +0 -6
  65. data/lib/generators/rodauth/templates/app/views/rodauth/_login_confirm_field.html.erb +0 -4
  66. data/lib/generators/rodauth/templates/app/views/rodauth/_login_display.html.erb +0 -4
  67. data/lib/generators/rodauth/templates/app/views/rodauth/_login_field.html.erb +0 -4
  68. data/lib/generators/rodauth/templates/app/views/rodauth/_login_hidden_field.html.erb +0 -1
  69. data/lib/generators/rodauth/templates/app/views/rodauth/_new_password_field.html.erb +0 -4
  70. data/lib/generators/rodauth/templates/app/views/rodauth/_otp_auth_code_field.html.erb +0 -8
  71. data/lib/generators/rodauth/templates/app/views/rodauth/_password_confirm_field.html.erb +0 -4
  72. data/lib/generators/rodauth/templates/app/views/rodauth/_password_field.html.erb +0 -4
  73. data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_code_field.html.erb +0 -4
  74. data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_codes_form.html.erb +0 -6
  75. data/lib/generators/rodauth/templates/app/views/rodauth/_sms_code_field.html.erb +0 -8
  76. data/lib/generators/rodauth/templates/app/views/rodauth/_sms_phone_field.html.erb +0 -8
  77. data/lib/generators/rodauth/templates/app/views/rodauth/_submit.html.erb +0 -3
@@ -1,7 +1,37 @@
1
- <%%= form_tag <%= rodauth %>.create_account_path, method: :post do %>
2
- <%%= render "login_field" %>
3
- <%%= render "login_confirm_field" if <%= rodauth %>.require_login_confirmation? %>
4
- <%%= render "password_field" if <%= rodauth %>.create_account_set_password? %>
5
- <%%= render "password_confirm_field" if <%= rodauth %>.create_account_set_password? && <%= rodauth %>.require_password_confirmation? %>
6
- <%%= render "submit", value: "Create Account" %>
7
- <%% end %>
1
+ <% content_for :title, rodauth.create_account_page_title %>
2
+
3
+ <%= form_with url: rodauth.create_account_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.label "login", rodauth.login_label, class: "form-label" %>
6
+ <%= 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)) %>
7
+ <%= content_tag(:span, rodauth.field_error(rodauth.login_param), class: "invalid-feedback", id: "login_error_message") if rodauth.field_error(rodauth.login_param) %>
8
+ </div>
9
+
10
+ <% if rodauth.require_login_confirmation? %>
11
+ <div class="form-group mb-3">
12
+ <%= form.label "login-confirm", rodauth.login_confirm_label, class: "form-label" %>
13
+ <%= form.email_field rodauth.login_confirm_param, value: params[rodauth.login_confirm_param], id: "login-confirm", autocomplete: "email", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.login_confirm_param)}", aria: ({ invalid: true, describedby: "login-confirm_error_message" } if rodauth.field_error(rodauth.login_confirm_param)) %>
14
+ <%= content_tag(:span, rodauth.field_error(rodauth.login_confirm_param), class: "invalid-feedback", id: "login-confirm_error_message") if rodauth.field_error(rodauth.login_confirm_param) %>
15
+ </div>
16
+ <% end %>
17
+
18
+ <% if rodauth.create_account_set_password? %>
19
+ <div class="form-group mb-3">
20
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
21
+ <%= 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)) %>
22
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
23
+ </div>
24
+
25
+ <% if rodauth.require_password_confirmation? %>
26
+ <div class="form-group mb-3">
27
+ <%= form.label "password-confirm", rodauth.password_confirm_label, class: "form-label" %>
28
+ <%= 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)) %>
29
+ <%= 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) %>
30
+ </div>
31
+ <% end %>
32
+ <% end %>
33
+
34
+ <div class="form-group mb-3">
35
+ <%= form.submit rodauth.create_account_button, class: "btn btn-primary" %>
36
+ </div>
37
+ <% end %>
@@ -1,3 +1,7 @@
1
- <%%= form_tag <%= rodauth %>.email_auth_path, method: :post do %>
2
- <%%= render "submit", value: "Login" %>
3
- <%% end %>
1
+ <% content_for :title, rodauth.email_auth_page_title %>
2
+
3
+ <%= form_with url: rodauth.email_auth_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.submit rodauth.login_button, class: "btn btn-primary" %>
6
+ </div>
7
+ <% end %>
@@ -1,3 +1,5 @@
1
- <%%= render "login_form_header" %>
2
- <%%= render "login_form" %>
3
- <%%= render "login_form_footer" %>
1
+ <% content_for :title, rodauth.login_page_title %>
2
+
3
+ <%= render "login_form_header" %>
4
+ <%= render "login_form" %>
5
+ <%= render "login_form_footer" %>
@@ -1,4 +1,16 @@
1
- <%%= form_tag <%= rodauth %>.logout_path, method: :post do %>
2
- <%%= render "global_logout_field" if <%= rodauth %>.features.include?(:active_sessions) %>
3
- <%%= render "submit", value: "Logout", class: "btn btn-warning" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.logout_page_title %>
2
+
3
+ <%= form_with url: rodauth.logout_path, method: :post do |form| %>
4
+ <% if rodauth.features.include?(:active_sessions) %>
5
+ <div class="form-group mb-3">
6
+ <div class="form-check">
7
+ <%= form.check_box rodauth.global_logout_param, id: "global-logout", class: "form-check-input" %>
8
+ <%= form.label "global-logout", rodauth.global_logout_label, class: "form-check-label" %>
9
+ </div>
10
+ </div>
11
+ <% end %>
12
+
13
+ <div class="form-group mb-3">
14
+ <%= form.submit rodauth.logout_button, class: "btn btn-warning" %>
15
+ </div>
16
+ <% end %>
@@ -1,3 +1,5 @@
1
- <%%= render "login_form_header" %>
2
- <%%= <%= rodauth %>.render_multi_phase_login_forms.html_safe %>
3
- <%%= render "login_form_footer" %>
1
+ <% content_for :title, rodauth.multi_phase_login_page_title %>
2
+
3
+ <%= render "login_form_header" %>
4
+ <%== rodauth.render_multi_phase_login_forms %>
5
+ <%= render "login_form_footer" %>
@@ -1,4 +1,17 @@
1
- <%%= form_tag <%= rodauth %>.otp_auth_path, method: :post do %>
2
- <%%= render "otp_auth_code_field" %>
3
- <%%= render "submit", value: "Authenticate Using TOTP" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.otp_auth_page_title %>
2
+
3
+ <%= form_with url: rodauth.otp_auth_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.label "otp-auth-code", rodauth.otp_auth_label, class: "form-label" %>
6
+ <div class="row">
7
+ <div class="col-sm-3">
8
+ <%= form.text_field rodauth.otp_auth_param, value: "", id: "otp-auth-code", autocomplete: "off", inputmode: "numeric", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.otp_auth_param)}", aria: ({ invalid: true, describedby: "otp-auth-code_error_message" } if rodauth.field_error(rodauth.otp_auth_param)) %>
9
+ <%= content_tag(:span, rodauth.field_error(rodauth.otp_auth_param), class: "invalid-feedback", id: "otp-auth-code_error_message") if rodauth.field_error(rodauth.otp_auth_param) %>
10
+ </div>
11
+ </div>
12
+ </div>
13
+
14
+ <div class="form-group mb-3">
15
+ <%= form.submit rodauth.otp_auth_button, class: "btn btn-primary" %>
16
+ </div>
17
+ <% end %>
@@ -1,4 +1,15 @@
1
- <%%= form_tag <%= rodauth %>.otp_disable_path, method: :post do %>
2
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
- <%%= render "submit", value: "Disable TOTP Authentication", class: "btn btn-warning" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.otp_disable_page_title %>
2
+
3
+ <%= form_with url: rodauth.otp_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.otp_disable_button, class: "btn btn-warning" %>
14
+ </div>
15
+ <% end %>
@@ -1,23 +1,43 @@
1
- <%%= form_tag <%= rodauth %>.otp_setup_path, method: :post do %>
2
- <%%= hidden_field_tag <%= rodauth %>.otp_setup_param, <%= rodauth %>.otp_user_key, id: "otp-key" %>
3
- <%%= hidden_field_tag <%= rodauth %>.otp_setup_raw_param, <%= rodauth %>.otp_key, id: "otp-hmac-secret" if <%= rodauth %>.otp_keys_use_hmac? %>
1
+ <% content_for :title, rodauth.otp_setup_page_title %>
2
+
3
+ <%= form_with url: rodauth.otp_setup_path, method: :post do |form| %>
4
+ <%= form.hidden_field rodauth.otp_setup_param, value: rodauth.otp_user_key, id: "otp-key" %>
5
+ <%= form.hidden_field rodauth.otp_setup_raw_param, value: rodauth.otp_key, id: "otp-hmac-secret" if rodauth.otp_keys_use_hmac? %>
4
6
 
5
7
  <div class="form-group mb-3">
6
- <p>Secret: <%%= <%= rodauth %>.otp_user_key %></p>
7
- <p>Provisioning URL: <%%= <%= rodauth %>.otp_provisioning_uri %></p>
8
+ <p><%= rodauth.otp_secret_label %>: <%= rodauth.otp_user_key %></p>
9
+ <p><%= rodauth.otp_provisioning_uri_label %>: <%= rodauth.otp_provisioning_uri %></p>
8
10
  </div>
9
11
 
10
12
  <div class="row">
11
13
  <div class="col-lg-6 col-lg">
12
14
  <div class="form-group mb-3">
13
- <p><%%= <%= rodauth %>.otp_qr_code.html_safe %></p>
15
+ <p><%== rodauth.otp_qr_code %></p>
14
16
  </div>
15
17
  </div>
16
18
 
17
19
  <div class="col-lg-6 col-lg">
18
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
19
- <%%= render "otp_auth_code_field" %>
20
- <%%= render "submit", value: "Setup TOTP Authentication" %>
20
+ <% if rodauth.two_factor_modifications_require_password? %>
21
+ <div class="form-group mb-3">
22
+ <%= form.label "password", rodauth.password_label, class: "form-label" %>
23
+ <%= 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)) %>
24
+ <%= content_tag(:span, rodauth.field_error(rodauth.password_param), class: "invalid-feedback", id: "password_error_message") if rodauth.field_error(rodauth.password_param) %>
25
+ </div>
26
+ <% end %>
27
+
28
+ <div class="form-group mb-3">
29
+ <%= form.label "otp-auth-code", rodauth.otp_auth_label, class: "form-label" %>
30
+ <div class="row">
31
+ <div class="col-sm-3">
32
+ <%= form.text_field rodauth.otp_auth_param, value: "", id: "otp-auth-code", autocomplete: "off", inputmode: "numeric", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.otp_auth_param)}", aria: ({ invalid: true, describedby: "otp-auth-code_error_message" } if rodauth.field_error(rodauth.otp_auth_param)) %>
33
+ <%= content_tag(:span, rodauth.field_error(rodauth.otp_auth_param), class: "invalid-feedback", id: "otp-auth-code_error_message") if rodauth.field_error(rodauth.otp_auth_param) %>
34
+ </div>
35
+ </div>
36
+ </div>
37
+
38
+ <div class="form-group mb-3">
39
+ <%= form.submit rodauth.otp_setup_button, class: "btn btn-primary" %>
40
+ </div>
21
41
  </div>
22
42
  </div>
23
- <%% end %>
43
+ <% end %>
@@ -1,4 +1,13 @@
1
- <%%= form_tag <%= rodauth %>.recovery_auth_path, method: :post do %>
2
- <%%= render "recovery_code_field" %>
3
- <%%= render "submit", value: "Authenticate via Recovery Code" %>
4
- <%% end %>
1
+ <% content_for :title, rodauth.recovery_auth_page_title %>
2
+
3
+ <%= form_with url: rodauth.recovery_auth_path, method: :post do |form| %>
4
+ <div class="form-group mb-3">
5
+ <%= form.label "recovery-code", rodauth.recovery_codes_label, class: "form-label" %>
6
+ <%= form.text_field rodauth.recovery_codes_param, value: "", id: "recovery-code", autocomplete: "off", required: true, class: "form-control #{"is-invalid" if rodauth.field_error(rodauth.recovery_codes_param)}", aria: ({ invalid: true, describedby: "recovery-code_error_message" } if rodauth.field_error(rodauth.recovery_codes_param)) %>
7
+ <%= content_tag(:span, rodauth.field_error(rodauth.recovery_codes_param), class: "invalid-feedback", id: "recovery-code_error_message") if rodauth.field_error(rodauth.recovery_codes_param) %>
8
+ </div>
9
+
10
+ <div class="form-group mb-3">
11
+ <%= form.submit rodauth.recovery_auth_button, class: "btn btn-primary" %>
12
+ </div>
13
+ <% end %>
@@ -1 +1,15 @@
1
- <%%= render "recovery_codes_form" %>
1
+ <% content_for :title, rodauth.recovery_codes_page_title %>
2
+
3
+ <%= form_with url: rodauth.recovery_codes_path, method: :post, data: { turbo: false } 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.recovery_codes_button || rodauth.view_recovery_codes_button, name: (rodauth.add_recovery_codes_param if rodauth.recovery_codes_button), class: "btn btn-primary" %>
14
+ </div>
15
+ <% end %>
@@ -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 %>