rodauth-rails 0.9.1 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +54 -0
- data/README.md +467 -249
- data/lib/generators/rodauth/install_generator.rb +17 -0
- data/lib/generators/rodauth/templates/app/lib/rodauth_app.rb +41 -30
- data/lib/generators/rodauth/templates/app/mailers/rodauth_mailer.rb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_email_auth_request_form.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/_field.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/_field_error.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/_global_logout_field.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/_login_confirm_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_login_display.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_login_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_login_form.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_footer.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/_login_form_header.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/_login_hidden_field.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/_new_password_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_otp_auth_code_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_password_confirm_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_password_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_code_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_recovery_codes_form.html.erb +4 -4
- data/lib/generators/rodauth/templates/app/views/rodauth/_sms_code_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_sms_phone_field.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/_submit.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/add_recovery_codes.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/change_login.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/change_password.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/close_account.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/confirm_password.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/create_account.html.erb +4 -4
- data/lib/generators/rodauth/templates/app/views/rodauth/email_auth.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/logout.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/multi_phase_login.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/otp_auth.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/otp_disable.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/otp_setup.html.erb +9 -9
- data/lib/generators/rodauth/templates/app/views/rodauth/recovery_auth.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/remember.html.erb +5 -5
- data/lib/generators/rodauth/templates/app/views/rodauth/reset_password.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/reset_password_request.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/sms_auth.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/sms_confirm.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/sms_disable.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/sms_request.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/sms_setup.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_auth.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_disable.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/two_factor_manage.html.erb +6 -6
- data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/unlock_account_request.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/verify_account.html.erb +3 -3
- data/lib/generators/rodauth/templates/app/views/rodauth/verify_account_resend.html.erb +2 -2
- data/lib/generators/rodauth/templates/app/views/rodauth/verify_login_change.html.erb +1 -1
- data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_auth.html.erb +7 -7
- data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_remove.html.erb +6 -6
- data/lib/generators/rodauth/templates/app/views/rodauth/webauthn_setup.html.erb +7 -7
- data/lib/generators/rodauth/templates/app/views/rodauth_mailer/unlock_account.text.erb +1 -1
- data/lib/generators/rodauth/views_generator.rb +25 -4
- data/lib/rodauth/rails.rb +36 -4
- data/lib/rodauth/rails/app.rb +19 -21
- data/lib/rodauth/rails/app/flash.rb +2 -8
- data/lib/rodauth/rails/app/middleware.rb +20 -10
- data/lib/rodauth/rails/auth.rb +37 -0
- data/lib/rodauth/rails/controller_methods.rb +1 -5
- data/lib/rodauth/rails/feature.rb +17 -210
- data/lib/rodauth/rails/feature/base.rb +62 -0
- data/lib/rodauth/rails/feature/callbacks.rb +61 -0
- data/lib/rodauth/rails/feature/csrf.rb +65 -0
- data/lib/rodauth/rails/feature/email.rb +30 -0
- data/lib/rodauth/rails/feature/instrumentation.rb +71 -0
- data/lib/rodauth/rails/feature/render.rb +48 -0
- data/lib/rodauth/rails/version.rb +1 -1
- data/rodauth-rails.gemspec +1 -1
- metadata +12 -6
- data/lib/generators/rodauth/mailer_generator.rb +0 -37
@@ -10,6 +10,15 @@ module Rodauth
|
|
10
10
|
include ::ActiveRecord::Generators::Migration
|
11
11
|
include MigrationHelpers
|
12
12
|
|
13
|
+
MAILER_VIEWS = %w[
|
14
|
+
email_auth
|
15
|
+
password_changed
|
16
|
+
reset_password
|
17
|
+
unlock_account
|
18
|
+
verify_account
|
19
|
+
verify_login_change
|
20
|
+
]
|
21
|
+
|
13
22
|
source_root "#{__dir__}/templates"
|
14
23
|
namespace "rodauth:install"
|
15
24
|
|
@@ -47,6 +56,14 @@ module Rodauth
|
|
47
56
|
template "app/models/account.rb"
|
48
57
|
end
|
49
58
|
|
59
|
+
def create_mailer
|
60
|
+
template "app/mailers/rodauth_mailer.rb"
|
61
|
+
|
62
|
+
MAILER_VIEWS.each do |view|
|
63
|
+
template "app/views/rodauth_mailer/#{view}.text.erb"
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
50
67
|
private
|
51
68
|
|
52
69
|
def sequel_uri_scheme
|
@@ -2,10 +2,10 @@ class RodauthApp < Rodauth::Rails::App
|
|
2
2
|
configure do
|
3
3
|
# List of authentication features that are loaded.
|
4
4
|
enable :create_account, :verify_account, :verify_account_grace_period,
|
5
|
-
:login, :logout<%= ", :remember" unless jwt? %>,
|
5
|
+
:login, :logout<%= ", :remember" unless jwt? %><%= ", :json" if json? %><%= ", :jwt" if jwt? %>,
|
6
6
|
:reset_password, :change_password, :change_password_notify,
|
7
7
|
:change_login, :verify_login_change,
|
8
|
-
:close_account
|
8
|
+
:close_account
|
9
9
|
|
10
10
|
# See the Rodauth documentation for the list of available config options:
|
11
11
|
# http://rodauth.jeremyevans.net/documentation.html
|
@@ -23,6 +23,10 @@ class RodauthApp < Rodauth::Rails::App
|
|
23
23
|
|
24
24
|
# Accept only JSON requests.
|
25
25
|
only_json? true
|
26
|
+
|
27
|
+
# Handle login and password confirmation fields on the client side.
|
28
|
+
# require_password_confirmation? false
|
29
|
+
# require_login_confirmation? false
|
26
30
|
<% end -%>
|
27
31
|
|
28
32
|
# Specify the controller used for view rendering and CSRF verification.
|
@@ -54,35 +58,29 @@ class RodauthApp < Rodauth::Rails::App
|
|
54
58
|
# already_logged_in { redirect login_redirect }
|
55
59
|
|
56
60
|
# ==> Emails
|
57
|
-
#
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
61
|
+
# Use a custom mailer for delivering authentication emails.
|
62
|
+
create_reset_password_email do
|
63
|
+
RodauthMailer.reset_password(email_to, reset_password_email_link)
|
64
|
+
end
|
65
|
+
create_verify_account_email do
|
66
|
+
RodauthMailer.verify_account(email_to, verify_account_email_link)
|
67
|
+
end
|
68
|
+
create_verify_login_change_email do |login|
|
69
|
+
RodauthMailer.verify_login_change(login, verify_login_change_old_login, verify_login_change_new_login, verify_login_change_email_link)
|
70
|
+
end
|
71
|
+
create_password_changed_email do
|
72
|
+
RodauthMailer.password_changed(email_to)
|
73
|
+
end
|
74
|
+
# create_email_auth_email do
|
75
|
+
# RodauthMailer.email_auth(email_to, email_auth_email_link)
|
69
76
|
# end
|
70
|
-
#
|
71
|
-
#
|
72
|
-
# # end
|
73
|
-
# # create_unlock_account_email do
|
74
|
-
# # RodauthMailer.unlock_account(email_to, unlock_account_email_link)
|
75
|
-
# # end
|
76
|
-
# send_email do |email|
|
77
|
-
# # queue email delivery on the mailer after the transaction commits
|
78
|
-
# db.after_commit { email.deliver_later }
|
77
|
+
# create_unlock_account_email do
|
78
|
+
# RodauthMailer.unlock_account(email_to, unlock_account_email_link)
|
79
79
|
# end
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
# send_email(&:deliver_later)
|
85
|
-
# reset_password_email_body { "Click here to reset your password: #{reset_password_email_link}" }
|
80
|
+
send_email do |email|
|
81
|
+
# queue email delivery on the mailer after the transaction commits
|
82
|
+
db.after_commit { email.deliver_later }
|
83
|
+
end
|
86
84
|
|
87
85
|
# ==> Flash
|
88
86
|
<% unless json? || jwt? -%>
|
@@ -151,14 +149,25 @@ class RodauthApp < Rodauth::Rails::App
|
|
151
149
|
# verify_account_grace_period 3.days
|
152
150
|
# reset_password_deadline_interval Hash[hours: 6]
|
153
151
|
# verify_login_change_deadline_interval Hash[days: 2]
|
152
|
+
<% unless jwt? -%>
|
154
153
|
# remember_deadline_interval Hash[days: 30]
|
154
|
+
<% end -%>
|
155
155
|
end
|
156
156
|
|
157
157
|
# ==> Multiple configurations
|
158
158
|
# configure(:admin) do
|
159
|
-
#
|
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 }
|
166
|
+
#
|
167
|
+
# # use separate tables (requires creating the new tables)
|
168
|
+
# methods.grep(/_table$/) do |table_method|
|
169
|
+
# public_send(table_method) { :"admin_#{super()}" }
|
170
|
+
# end
|
162
171
|
# end
|
163
172
|
|
164
173
|
route do |r|
|
@@ -187,6 +196,8 @@ class RodauthApp < Rodauth::Rails::App
|
|
187
196
|
# unless rodauth(:admin).logged_in?
|
188
197
|
# rodauth(:admin).require_http_basic_auth
|
189
198
|
# end
|
199
|
+
#
|
200
|
+
# r.pass # allow the Rails app to handle other "/admin/*" requests
|
190
201
|
# end
|
191
202
|
end
|
192
203
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
class
|
1
|
+
class RodauthMailer < ApplicationMailer
|
2
2
|
def verify_account(recipient, email_link)
|
3
3
|
@email_link = email_link
|
4
4
|
|
@@ -25,13 +25,13 @@ class <%= options[:name].camelize %>Mailer < ApplicationMailer
|
|
25
25
|
|
26
26
|
# def email_auth(recipient, email_link)
|
27
27
|
# @email_link = email_link
|
28
|
-
|
28
|
+
#
|
29
29
|
# mail to: recipient
|
30
30
|
# end
|
31
31
|
|
32
32
|
# def unlock_account(recipient, email_link)
|
33
33
|
# @email_link = email_link
|
34
|
-
|
34
|
+
#
|
35
35
|
# mail to: recipient
|
36
36
|
# end
|
37
37
|
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
|
8
|
-
aria: ({ invalid: "true", describedby: "#{name}_error_message" } if rodauth
|
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
|
2
|
-
<div class="invalid-feedback" id="<%%= name %>_error_message"><%%= rodauth
|
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
|
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
|
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
|
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
|
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
|
2
|
-
<%% if rodauth
|
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
|
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
|
1
|
+
<%% unless <%= rodauth %>.login_form_footer_links.empty? %>
|
2
2
|
<h2>Other Options</h2>
|
3
3
|
<ul>
|
4
|
-
<%% rodauth
|
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
|
2
|
-
<%%= render template: "<%=
|
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
|
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
|
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
|
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
|
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
|
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
|
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
|
2
|
-
<%%= render "password_field" if rodauth
|
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
|
5
|
-
name: (rodauth
|
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
|
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
|
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,6 +1,6 @@
|
|
1
|
-
<pre id="recovery-codes"><%%= rodauth
|
1
|
+
<pre id="recovery-codes"><%%= <%= rodauth %>.recovery_codes.map { |s| h(s) }.join("\n\n") %></pre>
|
2
2
|
|
3
|
-
<%% if rodauth
|
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
|
1
|
+
<%%= form_tag <%= rodauth %>.change_login_path, method: :post do %>
|
2
2
|
<%%= render "login_field" %>
|
3
|
-
<%%= render "login_confirm_field" if rodauth
|
4
|
-
<%%= render "password_field" if rodauth
|
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
|
2
|
-
<%%= render "password_field" if rodauth
|
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
|
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
|
2
|
-
<%%= render "password_field" if rodauth
|
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,7 +1,7 @@
|
|
1
|
-
<%%= form_tag rodauth
|
1
|
+
<%%= form_tag <%= rodauth %>.create_account_path, method: :post do %>
|
2
2
|
<%%= render "login_field" %>
|
3
|
-
<%%= render "login_confirm_field" if rodauth
|
4
|
-
<%%= render "password_field" if rodauth
|
5
|
-
<%%= render "password_confirm_field" if rodauth
|
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,4 +1,4 @@
|
|
1
|
-
<%%= form_tag rodauth
|
2
|
-
<%%= render "global_logout_field" if rodauth
|
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 %>
|