rodauth-rails 0.16.0 → 0.18.1

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 +54 -0
  3. data/README.md +97 -36
  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 -93
  50. data/lib/rodauth/rails/app.rb +4 -0
  51. data/lib/rodauth/rails/controller_methods.rb +1 -2
  52. data/lib/rodauth/rails/feature/base.rb +9 -0
  53. data/lib/rodauth/rails/feature/csrf.rb +15 -4
  54. data/lib/rodauth/rails/feature/internal_request.rb +16 -20
  55. data/lib/rodauth/rails/feature/render.rb +1 -1
  56. data/lib/rodauth/rails/model.rb +1 -1
  57. data/lib/rodauth/rails/railtie.rb +4 -2
  58. data/lib/rodauth/rails/version.rb +1 -1
  59. data/lib/rodauth/rails.rb +14 -7
  60. data/rodauth-rails.gemspec +1 -1
  61. metadata +4 -20
  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,4 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "login-confirm", "Confirm Login", class: "form-label" %>
3
- <%%= render "field", name: <%= rodauth %>.login_confirm_param, id: "login-confirm", type: :email, autocomplete: "email" %>
4
- </div>
@@ -1,4 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "login", "Login", class: "form-label" %>
3
- <%%= email_field_tag <%= rodauth %>.login_param, params[<%= rodauth %>.login_param], id: "login", readonly: true, class: "form-control-plaintext" %>
4
- </div>
@@ -1,4 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "login", "Login", class: "form-label" %>
3
- <%%= render "field", name: <%= rodauth %>.login_param, id: "login", type: :email, autocomplete: "email" %>
4
- </div>
@@ -1 +0,0 @@
1
- <%%= hidden_field_tag <%= rodauth %>.login_param, params[<%= rodauth %>.login_param] %>
@@ -1,4 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "new-password", "New Password", class: "form-label" %>
3
- <%%= render "field", name: <%= rodauth %>.new_password_param, id: "new-password", type: "password", value: "", autocomplete: "new-password" %>
4
- </div>
@@ -1,8 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "otp-auth-code", "Authentication Code", class: "form-label" %>
3
- <div class="row">
4
- <div class="col-sm-3">
5
- <%%= render "field", name: <%= rodauth %>.otp_auth_param, id: "otp-auth-code", value: "", autocomplete: "off", inputmode: "numeric" %>
6
- </div>
7
- </div>
8
- </div>
@@ -1,4 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "password-confirm", "Confirm Password", class: "form-label" %>
3
- <%%= render "field", name: <%= rodauth %>.password_confirm_param, id: "password-confirm", type: :password, value: "", autocomplete: "new-password" %>
4
- </div>
@@ -1,4 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "password", "Password", class: "form-label" %>
3
- <%%= render "field", name: <%= rodauth %>.password_param, id: "password", type: :password, value: "", autocomplete: <%= rodauth %>.password_field_autocomplete_value %>
4
- </div>
@@ -1,4 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "recovery_code", "Recovery Code", class: "form-label" %>
3
- <%%= render "field", name: <%= rodauth %>.recovery_codes_param, id: "recovery_code", value: "", autocomplete: "off" %>
4
- </div>
@@ -1,6 +0,0 @@
1
- <%%= form_tag <%= rodauth %>.recovery_codes_path, method: :post do %>
2
- <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
- <%%= render "submit",
4
- value: <%= rodauth %>.recovery_codes_button || "View Authentication Recovery Codes",
5
- name: (<%= rodauth %>.add_recovery_codes_param if <%= rodauth %>.recovery_codes_button) %>
6
- <%% end %>
@@ -1,8 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "sms-code", "SMS Code", class: "form-label" %>
3
- <div class="row">
4
- <div class="col-sm-3">
5
- <%%= render "field", name: <%= rodauth %>.sms_code_param, id: "sms-code", value: "", autocomplete: "one-time-code", inputmode: "numeric" %>
6
- </div>
7
- </div>
8
- </div>
@@ -1,8 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= label_tag "sms-phone", "Phone Number", class: "form-label" %>
3
- <div class="row">
4
- <div class="col-sm-3">
5
- <%%= render "field", name: <%= rodauth %>.sms_phone_param, id: "sms-phone", type: :tel, autocomplete: "tel" %>
6
- </div>
7
- </div>
8
- </div>
@@ -1,3 +0,0 @@
1
- <div class="form-group mb-3">
2
- <%%= submit_tag local_assigns[:value], name: local_assigns[:name], class: local_assigns[:class] || "btn btn-primary" %>
3
- </div>