rodauth-rails 0.11.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -0
  3. data/README.md +316 -218
  4. data/lib/generators/rodauth/templates/app/lib/rodauth_app.rb +8 -4
  5. data/lib/generators/rodauth/templates/app/models/account.rb +1 -0
  6. data/lib/generators/rodauth/templates/app/views/rodauth/_email_auth_request_form.html.erb +1 -1
  7. data/lib/generators/rodauth/templates/app/views/rodauth/_field.html.erb +2 -2
  8. data/lib/generators/rodauth/templates/app/views/rodauth/_field_error.html.erb +2 -2
  9. data/lib/generators/rodauth/templates/app/views/rodauth/_global_logout_field.html.erb +2 -2
  10. data/lib/generators/rodauth/templates/app/views/rodauth/_login_confirm_field.html.erb +3 -3
  11. data/lib/generators/rodauth/templates/app/views/rodauth/_login_display.html.erb +3 -3
  12. data/lib/generators/rodauth/templates/app/views/rodauth/_login_field.html.erb +3 -3
  13. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form.html.erb +3 -3
  14. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_footer.html.erb +2 -2
  15. data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_header.html.erb +2 -2
  16. data/lib/generators/rodauth/templates/app/views/rodauth/_login_hidden_field.html.erb +1 -1
  17. data/lib/generators/rodauth/templates/app/views/rodauth/_new_password_field.html.erb +3 -3
  18. data/lib/generators/rodauth/templates/app/views/rodauth/_otp_auth_code_field.html.erb +3 -3
  19. data/lib/generators/rodauth/templates/app/views/rodauth/_password_confirm_field.html.erb +3 -3
  20. data/lib/generators/rodauth/templates/app/views/rodauth/_password_field.html.erb +3 -3
  21. data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_code_field.html.erb +3 -3
  22. data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_codes_form.html.erb +4 -4
  23. data/lib/generators/rodauth/templates/app/views/rodauth/_sms_code_field.html.erb +3 -3
  24. data/lib/generators/rodauth/templates/app/views/rodauth/_sms_phone_field.html.erb +3 -3
  25. data/lib/generators/rodauth/templates/app/views/rodauth/_submit.html.erb +1 -1
  26. data/lib/generators/rodauth/templates/app/views/rodauth/add_recovery_codes.html.erb +2 -2
  27. data/lib/generators/rodauth/templates/app/views/rodauth/change_login.html.erb +3 -3
  28. data/lib/generators/rodauth/templates/app/views/rodauth/change_password.html.erb +3 -3
  29. data/lib/generators/rodauth/templates/app/views/rodauth/close_account.html.erb +2 -2
  30. data/lib/generators/rodauth/templates/app/views/rodauth/confirm_password.html.erb +1 -1
  31. data/lib/generators/rodauth/templates/app/views/rodauth/create_account.html.erb +4 -4
  32. data/lib/generators/rodauth/templates/app/views/rodauth/email_auth.html.erb +1 -1
  33. data/lib/generators/rodauth/templates/app/views/rodauth/logout.html.erb +2 -2
  34. data/lib/generators/rodauth/templates/app/views/rodauth/multi_phase_login.html.erb +1 -1
  35. data/lib/generators/rodauth/templates/app/views/rodauth/otp_auth.html.erb +1 -1
  36. data/lib/generators/rodauth/templates/app/views/rodauth/otp_disable.html.erb +2 -2
  37. data/lib/generators/rodauth/templates/app/views/rodauth/otp_setup.html.erb +9 -9
  38. data/lib/generators/rodauth/templates/app/views/rodauth/recovery_auth.html.erb +1 -1
  39. data/lib/generators/rodauth/templates/app/views/rodauth/remember.html.erb +5 -5
  40. data/lib/generators/rodauth/templates/app/views/rodauth/reset_password.html.erb +2 -2
  41. data/lib/generators/rodauth/templates/app/views/rodauth/reset_password_request.html.erb +2 -2
  42. data/lib/generators/rodauth/templates/app/views/rodauth/sms_auth.html.erb +1 -1
  43. data/lib/generators/rodauth/templates/app/views/rodauth/sms_confirm.html.erb +1 -1
  44. data/lib/generators/rodauth/templates/app/views/rodauth/sms_disable.html.erb +2 -2
  45. data/lib/generators/rodauth/templates/app/views/rodauth/sms_request.html.erb +1 -1
  46. data/lib/generators/rodauth/templates/app/views/rodauth/sms_setup.html.erb +2 -2
  47. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_auth.html.erb +1 -1
  48. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_disable.html.erb +2 -2
  49. data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_manage.html.erb +6 -6
  50. data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account.html.erb +2 -2
  51. data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account_request.html.erb +1 -1
  52. data/lib/generators/rodauth/templates/app/views/rodauth/verify_account.html.erb +3 -3
  53. data/lib/generators/rodauth/templates/app/views/rodauth/verify_account_resend.html.erb +2 -2
  54. data/lib/generators/rodauth/templates/app/views/rodauth/verify_login_change.html.erb +1 -1
  55. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_auth.html.erb +7 -7
  56. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_remove.html.erb +6 -6
  57. data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_setup.html.erb +7 -7
  58. data/lib/generators/rodauth/views_generator.rb +26 -4
  59. data/lib/rodauth/rails.rb +32 -13
  60. data/lib/rodauth/rails/auth.rb +9 -12
  61. data/lib/rodauth/rails/feature.rb +19 -230
  62. data/lib/rodauth/rails/feature/base.rb +62 -0
  63. data/lib/rodauth/rails/feature/callbacks.rb +65 -0
  64. data/lib/rodauth/rails/feature/csrf.rb +65 -0
  65. data/lib/rodauth/rails/feature/email.rb +30 -0
  66. data/lib/rodauth/rails/feature/instrumentation.rb +71 -0
  67. data/lib/rodauth/rails/feature/internal_request.rb +50 -0
  68. data/lib/rodauth/rails/feature/render.rb +48 -0
  69. data/lib/rodauth/rails/model.rb +101 -0
  70. data/lib/rodauth/rails/model/associations.rb +195 -0
  71. data/lib/rodauth/rails/railtie.rb +0 -5
  72. data/lib/rodauth/rails/tasks.rake +5 -5
  73. data/lib/rodauth/rails/version.rb +1 -1
  74. data/rodauth-rails.gemspec +4 -1
  75. metadata +56 -6
  76. data/lib/rodauth/rails/log_subscriber.rb +0 -34
@@ -154,11 +154,15 @@ class RodauthApp < Rodauth::Rails::App
154
154
  <% end -%>
155
155
  end
156
156
 
157
- # ==> Multiple configurations
157
+ # ==> Secondary configurations
158
158
  # configure(:admin) do
159
- # enable :http_basic_auth # enable different set of features
159
+ # # ... enable features ...
160
160
  # prefix "/admin"
161
161
  # session_key_prefix "admin_"
162
+ # # remember_cookie_key "_admin_remember" # if using remember feature
163
+ #
164
+ # # search views in `app/views/admin/rodauth` directory
165
+ # rails_controller { Admin::RodauthController }
162
166
  # end
163
167
 
164
168
  route do |r|
@@ -180,7 +184,7 @@ class RodauthApp < Rodauth::Rails::App
180
184
  # rodauth.require_authentication
181
185
  # end
182
186
 
183
- # ==> Multiple configurations
187
+ # ==> Secondary configurations
184
188
  # r.on "admin" do
185
189
  # r.rodauth(:admin)
186
190
  #
@@ -188,7 +192,7 @@ class RodauthApp < Rodauth::Rails::App
188
192
  # rodauth(:admin).require_http_basic_auth
189
193
  # end
190
194
  #
191
- # r.pass # allow the Rails app to handle other "/admin/*" requests
195
+ # break # allow the Rails app to handle other "/admin/*" requests
192
196
  # end
193
197
  end
194
198
  end
@@ -1,2 +1,3 @@
1
1
  class Account < ApplicationRecord
2
+ include Rodauth::Rails.model
2
3
  end
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.email_auth_request_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.email_auth_request_path, method: :post do %>
2
2
  <%%= render "login_hidden_field" %>
3
3
  <%%= render "submit", value: "Send Login Link Via Email" %>
4
4
  <%% end %>
@@ -4,7 +4,7 @@
4
4
  autocomplete: local_assigns[:autocomplete],
5
5
  inputmode: local_assigns[:inputmode],
6
6
  required: local_assigns[:required] != false,
7
- class: "#{local_assigns[:class] || "form-control"} #{"is-invalid" if rodauth.field_error(name)}",
8
- aria: ({ invalid: "true", describedby: "#{name}_error_message" } if rodauth.field_error(name)) %>
7
+ class: "#{local_assigns[:class] || "form-control"} #{"is-invalid" if <%= rodauth %>.field_error(name)}",
8
+ aria: ({ invalid: "true", describedby: "#{name}_error_message" } if <%= rodauth %>.field_error(name)) %>
9
9
 
10
10
  <%%= render "field_error", name: name unless local_assigns[:skip_error_message] %>
@@ -1,3 +1,3 @@
1
- <%% if rodauth.field_error(name) %>
2
- <div class="invalid-feedback" id="<%%= name %>_error_message"><%%= rodauth.field_error(name) %></div>
1
+ <%% if <%= rodauth %>.field_error(name) %>
2
+ <div class="invalid-feedback" id="<%%= name %>_error_message"><%%= <%= rodauth %>.field_error(name) %></div>
3
3
  <%% end %>
@@ -1,6 +1,6 @@
1
- <div class="form-group">
1
+ <div class="form-group mb-3">
2
2
  <div class="form-check">
3
- <%%= check_box_tag rodauth.global_logout_param, "t", false, id: "global-logout", class: "form-check-input" %>
3
+ <%%= check_box_tag <%= rodauth %>.global_logout_param, "t", false, id: "global-logout", class: "form-check-input" %>
4
4
  <%%= label_tag "global-logout", "Logout all Logged In Sessons?", class: "form-check-label" %>
5
5
  </div>
6
6
  </div>
@@ -1,4 +1,4 @@
1
- <div class="form-group">
2
- <%%= label_tag "login-confirm", "Confirm Login" %>
3
- <%%= render "field", name: rodauth.login_confirm_param, id: "login-confirm", type: :email, autocomplete: "email" %>
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
4
  </div>
@@ -1,4 +1,4 @@
1
- <div class="form-group">
2
- <%%= label_tag "login", "Login" %>
3
- <%%= email_field_tag rodauth.login_param, params[rodauth.login_param], id: "login", readonly: true, class: "form-control-plaintext" %>
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
4
  </div>
@@ -1,4 +1,4 @@
1
- <div class="form-group">
2
- <%%= label_tag "login", "Login" %>
3
- <%%= render "field", name: rodauth.login_param, id: "login", type: :email, autocomplete: "email" %>
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
4
  </div>
@@ -1,9 +1,9 @@
1
- <%%= form_tag rodauth.login_path, method: :post do %>
2
- <%% if rodauth.skip_login_field_on_login? %>
1
+ <%%= form_tag <%= rodauth %>.login_path, method: :post do %>
2
+ <%% if <%= rodauth %>.skip_login_field_on_login? %>
3
3
  <%%= render "login_display" %>
4
4
  <%% else %>
5
5
  <%%= render "login_field" %>
6
6
  <%% end %>
7
- <%%= render "password_field" unless rodauth.skip_password_field_on_login? %>
7
+ <%%= render "password_field" unless <%= rodauth %>.skip_password_field_on_login? %>
8
8
  <%%= render "submit", value: "Login" %>
9
9
  <%% end %>
@@ -1,7 +1,7 @@
1
- <%% unless rodauth.login_form_footer_links.empty? %>
1
+ <%% unless <%= rodauth %>.login_form_footer_links.empty? %>
2
2
  <h2>Other Options</h2>
3
3
  <ul>
4
- <%% rodauth.login_form_footer_links.sort.each do |_, link, text| %>
4
+ <%% <%= rodauth %>.login_form_footer_links.sort.each do |_, link, text| %>
5
5
  <li><%%= link_to text, link %></li>
6
6
  <%% end %>
7
7
  </ul>
@@ -1,3 +1,3 @@
1
- <%% if rodauth.field_error("password") && rodauth.features.include?(:reset_password) %>
2
- <%%= render template: "<%= options[:directory] %>/reset_password_request", layout: false %>
1
+ <%% if <%= rodauth %>.field_error("password") && <%= rodauth %>.features.include?(:reset_password) %>
2
+ <%%= render template: "<%= directory %>/reset_password_request", layout: false %>
3
3
  <%% end %>
@@ -1 +1 @@
1
- <%%= hidden_field_tag rodauth.login_param, params[rodauth.login_param] %>
1
+ <%%= hidden_field_tag <%= rodauth %>.login_param, params[<%= rodauth %>.login_param] %>
@@ -1,4 +1,4 @@
1
- <div class="form-group">
2
- <%%= label_tag "new-password", "New Password" %>
3
- <%%= render "field", name: rodauth.new_password_param, id: "new-password", type: "password", value: "", autocomplete: "new-password" %>
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
4
  </div>
@@ -1,8 +1,8 @@
1
- <div class="form-group">
2
- <%%= label_tag "otp-auth-code", "Authentication Code" %>
1
+ <div class="form-group mb-3">
2
+ <%%= label_tag "otp-auth-code", "Authentication Code", class: "form-label" %>
3
3
  <div class="row">
4
4
  <div class="col-sm-3">
5
- <%%= render "field", name: rodauth.otp_auth_param, id: "otp-auth-code", value: "", autocomplete: "off", inputmode: "numeric" %>
5
+ <%%= render "field", name: <%= rodauth %>.otp_auth_param, id: "otp-auth-code", value: "", autocomplete: "off", inputmode: "numeric" %>
6
6
  </div>
7
7
  </div>
8
8
  </div>
@@ -1,4 +1,4 @@
1
- <div class="form-group">
2
- <%%= label_tag "password-confirm", "Confirm Password" %>
3
- <%%= render "field", name: rodauth.password_confirm_param, id: "password-confirm", type: :password, value: "", autocomplete: "new-password" %>
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
4
  </div>
@@ -1,4 +1,4 @@
1
- <div class="form-group">
2
- <%%= label_tag "password", "Password" %>
3
- <%%= render "field", name: rodauth.password_param, id: "password", type: :password, value: "", autocomplete: rodauth.password_field_autocomplete_value %>
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
4
  </div>
@@ -1,4 +1,4 @@
1
- <div class="form-group">
2
- <%%= label_tag "recovery_code", "Recovery Code" %>
3
- <%%= render "field", name: rodauth.recovery_codes_param, id: "recovery_code", value: "", autocomplete: "off" %>
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
4
  </div>
@@ -1,6 +1,6 @@
1
- <%%= form_tag rodauth.recovery_codes_path, method: :post do %>
2
- <%%= render "password_field" if rodauth.two_factor_modifications_require_password? %>
1
+ <%%= form_tag <%= rodauth %>.recovery_codes_path, method: :post do %>
2
+ <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
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) %>
4
+ value: <%= rodauth %>.recovery_codes_button || "View Authentication Recovery Codes",
5
+ name: (<%= rodauth %>.add_recovery_codes_param if <%= rodauth %>.recovery_codes_button) %>
6
6
  <%% end %>
@@ -1,8 +1,8 @@
1
- <div class="form-group">
2
- <%%= label_tag "sms-code", "SMS Code" %>
1
+ <div class="form-group mb-3">
2
+ <%%= label_tag "sms-code", "SMS Code", class: "form-label" %>
3
3
  <div class="row">
4
4
  <div class="col-sm-3">
5
- <%%= render "field", name: rodauth.sms_code_param, id: "sms-code", value: "", autocomplete: "one-time-code", inputmode: "numeric" %>
5
+ <%%= render "field", name: <%= rodauth %>.sms_code_param, id: "sms-code", value: "", autocomplete: "one-time-code", inputmode: "numeric" %>
6
6
  </div>
7
7
  </div>
8
8
  </div>
@@ -1,8 +1,8 @@
1
- <div class="form-group">
2
- <%%= label_tag "sms-phone", "Phone Number" %>
1
+ <div class="form-group mb-3">
2
+ <%%= label_tag "sms-phone", "Phone Number", class: "form-label" %>
3
3
  <div class="row">
4
4
  <div class="col-sm-3">
5
- <%%= render "field", name: rodauth.sms_phone_param, id: "sms-phone", type: :tel, autocomplete: "tel" %>
5
+ <%%= render "field", name: <%= rodauth %>.sms_phone_param, id: "sms-phone", type: :tel, autocomplete: "tel" %>
6
6
  </div>
7
7
  </div>
8
8
  </div>
@@ -1,3 +1,3 @@
1
- <div class="form-group">
1
+ <div class="form-group mb-3">
2
2
  <%%= submit_tag local_assigns[:value], name: local_assigns[:name], class: local_assigns[:class] || "btn btn-primary" %>
3
3
  </div>
@@ -1,6 +1,6 @@
1
- <pre id="recovery-codes"><%%= rodauth.recovery_codes.map { |s| h(s) }.join("\n\n") %></pre>
1
+ <pre id="recovery-codes"><%%= <%= rodauth %>.recovery_codes.map { |s| h(s) }.join("\n\n") %></pre>
2
2
 
3
- <%% if rodauth.can_add_recovery_codes? %>
3
+ <%% if <%= rodauth %>.can_add_recovery_codes? %>
4
4
  <h2>Add Additional Recovery Codes</h2>
5
5
  <%%= render "recovery_codes_form" %>
6
6
  <%% end %>
@@ -1,6 +1,6 @@
1
- <%%= form_tag rodauth.change_login_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.change_login_path, method: :post do %>
2
2
  <%%= render "login_field" %>
3
- <%%= render "login_confirm_field" if rodauth.require_login_confirmation? %>
4
- <%%= render "password_field" if rodauth.change_login_requires_password? %>
3
+ <%%= render "login_confirm_field" if <%= rodauth %>.require_login_confirmation? %>
4
+ <%%= render "password_field" if <%= rodauth %>.change_login_requires_password? %>
5
5
  <%%= render "submit", value: "Change Login" %>
6
6
  <%% end %>
@@ -1,6 +1,6 @@
1
- <%%= form_tag rodauth.change_password_path, method: :post do %>
2
- <%%= render "password_field" if rodauth.change_password_requires_password? %>
1
+ <%%= form_tag <%= rodauth %>.change_password_path, method: :post do %>
2
+ <%%= render "password_field" if <%= rodauth %>.change_password_requires_password? %>
3
3
  <%%= render "new_password_field" %>
4
- <%%= render "password_confirm_field" if rodauth.require_password_confirmation? %>
4
+ <%%= render "password_confirm_field" if <%= rodauth %>.require_password_confirmation? %>
5
5
  <%%= render "submit", value: "Change Password" %>
6
6
  <%% end %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.close_account_path, method: :post do %>
2
- <%%= render "password_field" if rodauth.close_account_requires_password? %>
1
+ <%%= form_tag <%= rodauth %>.close_account_path, method: :post do %>
2
+ <%%= render "password_field" if <%= rodauth %>.close_account_requires_password? %>
3
3
  <%%= render "submit", value: "Close Account", class: "btn btn-danger" %>
4
4
  <%% end %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.confirm_password_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.confirm_password_path, method: :post do %>
2
2
  <%%= render "password_field" %>
3
3
  <%%= render "submit", value: "Confirm Password" %>
4
4
  <%% end %>
@@ -1,7 +1,7 @@
1
- <%%= form_tag rodauth.create_account_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.create_account_path, method: :post do %>
2
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? %>
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
6
  <%%= render "submit", value: "Create Account" %>
7
7
  <%% end %>
@@ -1,3 +1,3 @@
1
- <%%= form_tag rodauth.email_auth_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.email_auth_path, method: :post do %>
2
2
  <%%= render "submit", value: "Login" %>
3
3
  <%% end %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.logout_path, method: :post do %>
2
- <%%= render "global_logout_field" if rodauth.features.include?(:active_sessions) %>
1
+ <%%= form_tag <%= rodauth %>.logout_path, method: :post do %>
2
+ <%%= render "global_logout_field" if <%= rodauth %>.features.include?(:active_sessions) %>
3
3
  <%%= render "submit", value: "Logout", class: "btn btn-warning" %>
4
4
  <%% end %>
@@ -1,3 +1,3 @@
1
1
  <%%= render "login_form_header" %>
2
- <%%= rodauth.render_multi_phase_login_forms.html_safe %>
2
+ <%%= <%= rodauth %>.render_multi_phase_login_forms.html_safe %>
3
3
  <%%= render "login_form_footer" %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.otp_auth_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.otp_auth_path, method: :post do %>
2
2
  <%%= render "otp_auth_code_field" %>
3
3
  <%%= render "submit", value: "Authenticate Using TOTP" %>
4
4
  <%% end %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.otp_disable_path, method: :post do %>
2
- <%%= render "password_field" if rodauth.two_factor_modifications_require_password? %>
1
+ <%%= form_tag <%= rodauth %>.otp_disable_path, method: :post do %>
2
+ <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
3
  <%%= render "submit", value: "Disable TOTP Authentication", class: "btn btn-warning" %>
4
4
  <%% end %>
@@ -1,21 +1,21 @@
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
+ <%%= 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? %>
4
4
 
5
- <div class="form-group">
6
- <p>Secret: <%%= rodauth.otp_user_key %></p>
7
- <p>Provisioning URL: <%%= rodauth.otp_provisioning_uri %></p>
5
+ <div class="form-group mb-3">
6
+ <p>Secret: <%%= <%= rodauth %>.otp_user_key %></p>
7
+ <p>Provisioning URL: <%%= <%= rodauth %>.otp_provisioning_uri %></p>
8
8
  </div>
9
9
 
10
10
  <div class="row">
11
11
  <div class="col-lg-6 col-lg">
12
- <div class="form-group">
13
- <p><%%= rodauth.otp_qr_code.html_safe %></p>
12
+ <div class="form-group mb-3">
13
+ <p><%%= <%= rodauth %>.otp_qr_code.html_safe %></p>
14
14
  </div>
15
15
  </div>
16
16
 
17
17
  <div class="col-lg-6 col-lg">
18
- <%%= render "password_field" if rodauth.two_factor_modifications_require_password? %>
18
+ <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
19
19
  <%%= render "otp_auth_code_field" %>
20
20
  <%%= render "submit", value: "Setup TOTP Authentication" %>
21
21
  </div>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.recovery_auth_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.recovery_auth_path, method: :post do %>
2
2
  <%%= render "recovery_code_field" %>
3
3
  <%%= render "submit", value: "Authenticate via Recovery Code" %>
4
4
  <%% end %>
@@ -1,17 +1,17 @@
1
- <%%= form_tag rodauth.remember_path, method: :post do %>
2
- <fieldset class="form-group">
1
+ <%%= form_tag <%= rodauth %>.remember_path, method: :post do %>
2
+ <fieldset class="form-group mb-3">
3
3
  <div class="form-check">
4
- <%%= radio_button_tag rodauth.remember_param, rodauth.remember_remember_param_value, false, id: "remember-remember", class: "form-check-input" %>
4
+ <%%= radio_button_tag <%= rodauth %>.remember_param, <%= rodauth %>.remember_remember_param_value, false, id: "remember-remember", class: "form-check-input" %>
5
5
  <%%= label_tag "remember-remember", "Remember Me", class: "form-check-label" %>
6
6
  </div>
7
7
 
8
8
  <div class="form-check">
9
- <%%= radio_button_tag rodauth.remember_param, rodauth.remember_forget_param_value, false, id: "remember-forget", class: "form-check-input" %>
9
+ <%%= radio_button_tag <%= rodauth %>.remember_param, <%= rodauth %>.remember_forget_param_value, false, id: "remember-forget", class: "form-check-input" %>
10
10
  <%%= label_tag "remember-forget", "Forget Me", class: "form-check-label" %>
11
11
  </div>
12
12
 
13
13
  <div class="form-check">
14
- <%%= radio_button_tag rodauth.remember_param, rodauth.remember_disable_param_value, false, id: "remember-disable", class: "form-check-input" %>
14
+ <%%= radio_button_tag <%= rodauth %>.remember_param, <%= rodauth %>.remember_disable_param_value, false, id: "remember-disable", class: "form-check-input" %>
15
15
  <%%= label_tag "remember-disable", "Disable Remember Me", class: "form-check-label" %>
16
16
  </div>
17
17
  </fieldset>
@@ -1,5 +1,5 @@
1
- <%%= form_tag rodauth.reset_password_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.reset_password_path, method: :post do %>
2
2
  <%%= render "password_field" %>
3
- <%%= render "password_confirm_field" if rodauth.require_password_confirmation? %>
3
+ <%%= render "password_confirm_field" if <%= rodauth %>.require_password_confirmation? %>
4
4
  <%%= render "submit", value: "Reset Password" %>
5
5
  <%% end %>
@@ -1,6 +1,6 @@
1
- <%%= form_tag rodauth.reset_password_request_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.reset_password_request_path, method: :post do %>
2
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) %>
3
+ <%% if params[<%= rodauth %>.login_param] && !<%= rodauth %>.field_error(<%= rodauth %>.login_param) %>
4
4
  <%%= render "login_hidden_field" %>
5
5
  <%% else %>
6
6
  <%%= render "login_field" %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.sms_auth_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.sms_auth_path, method: :post do %>
2
2
  <%%= render "sms_code_field" %>
3
3
  <%%= render "submit", value: "Authenticate via SMS Code" %>
4
4
  <%% end %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.sms_confirm_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.sms_confirm_path, method: :post do %>
2
2
  <%%= render "sms_code_field" %>
3
3
  <%%= render "submit", value: "Confirm SMS Backup Number" %>
4
4
  <%% end %>
@@ -1,4 +1,4 @@
1
- <%%= form_tag rodauth.sms_disable_path, method: :post do %>
2
- <%%= render "password_field" if rodauth.two_factor_modifications_require_password? %>
1
+ <%%= form_tag <%= rodauth %>.sms_disable_path, method: :post do %>
2
+ <%%= render "password_field" if <%= rodauth %>.two_factor_modifications_require_password? %>
3
3
  <%%= render "submit", value: "Disable Backup SMS Authentication" %>
4
4
  <%% end %>
@@ -1,3 +1,3 @@
1
- <%%= form_tag rodauth.sms_request_path, method: :post do %>
1
+ <%%= form_tag <%= rodauth %>.sms_request_path, method: :post do %>
2
2
  <%%= render "submit", value: "Send SMS Code" %>
3
3
  <%% end %>