lesli_shield 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Rakefile +3 -0
- data/app/assets/stylesheets/lesli_shield/application.css +1222 -1
- data/app/assets/stylesheets/lesli_shield/confirmations.css +917 -18
- data/app/assets/stylesheets/lesli_shield/confirmations.tailwind.css +918 -0
- data/app/assets/stylesheets/lesli_shield/invitations.css +1008 -0
- data/app/assets/stylesheets/lesli_shield/passwords.css +872 -18
- data/app/assets/stylesheets/lesli_shield/passwords.tailwind.css +873 -0
- data/app/assets/stylesheets/lesli_shield/registrations.css +904 -832
- data/app/assets/stylesheets/lesli_shield/registrations.tailwind.css +908 -0
- data/app/assets/stylesheets/lesli_shield/sessions.css +984 -32
- data/app/assets/stylesheets/lesli_shield/sessions.tailwind.css +983 -1
- data/app/controllers/lesli_shield/invites_controller.rb +100 -49
- data/app/controllers/lesli_shield/profile/passwords_controller.rb +119 -0
- data/app/controllers/lesli_shield/profiles_controller.rb +69 -0
- data/app/controllers/lesli_shield/role/actions_controller.rb +134 -38
- data/app/controllers/lesli_shield/roles_controller.rb +114 -141
- data/app/controllers/lesli_shield/sessions_controller.rb +1 -2
- data/app/controllers/lesli_shield/users_controller.rb +11 -4
- data/app/controllers/users/confirmations_controller.rb +162 -49
- data/app/controllers/users/invitations_controller.rb +101 -0
- data/app/controllers/users/passwords_controller.rb +211 -28
- data/app/controllers/users/registrations_controller.rb +108 -83
- data/app/controllers/users/sessions_controller.rb +124 -84
- data/app/interfaces/lesli_shield/authorization_interface.rb +2 -2
- data/app/jobs/lesli_shield/invitation_delivery_job.rb +123 -0
- data/app/mailers/lesli_shield/devise_mailer.rb +73 -17
- data/app/mailers/lesli_shield/invitation_mailer.rb +58 -0
- data/app/models/concerns/lesli_shield/role_management.rb +70 -0
- data/app/models/concerns/lesli_shield/user_authentication.rb +54 -0
- data/app/models/concerns/lesli_shield/user_security.rb +22 -19
- data/app/models/lesli_shield/account.rb +4 -1
- data/app/models/lesli_shield/invite.rb +183 -12
- data/app/models/lesli_shield/user/role.rb +1 -1
- data/app/models/lesli_shield/user.rb +5 -2
- data/app/services/lesli_shield/invitation_audit.rb +34 -0
- data/app/services/lesli_shield/invitation_email_policy.rb +64 -0
- data/app/services/lesli_shield/invitation_service.rb +405 -0
- data/app/services/lesli_shield/invite_service.rb +34 -5
- data/app/services/lesli_shield/profile/password_service.rb +47 -0
- data/app/services/lesli_shield/profile_service.rb +25 -0
- data/app/services/lesli_shield/role_action_service.rb +37 -92
- data/app/services/lesli_shield/role_audit.rb +42 -0
- data/app/services/lesli_shield/role_permission_service.rb +347 -0
- data/app/services/lesli_shield/role_privilege_deployment_service.rb +79 -0
- data/app/services/lesli_shield/role_privilege_service.rb +69 -105
- data/app/services/lesli_shield/role_service.rb +431 -0
- data/app/services/lesli_shield/user_registration_service.rb +41 -74
- data/app/services/lesli_shield/user_session_service.rb +1 -1
- data/app/services/lesli_shield/user_validator_service.rb +37 -39
- data/app/views/devise/confirmations/new.html.erb +58 -12
- data/app/views/devise/confirmations/show.html.erb +27 -60
- data/app/views/devise/passwords/edit.html.erb +59 -25
- data/app/views/devise/passwords/new.html.erb +61 -26
- data/app/views/devise/registrations/new.html.erb +83 -56
- data/app/views/devise/sessions/new.html.erb +58 -41
- data/app/views/devise/shared/_application-devise-simple.erb +18 -19
- data/app/views/devise/shared/_demo.html.erb +8 -6
- data/app/views/devise/shared/_error_messages.html.erb +45 -10
- data/app/views/devise/shared/_links.html.erb +10 -20
- data/app/views/lesli_shield/invites/_form.html.erb +64 -7
- data/app/views/lesli_shield/invites/_invite.html.erb +55 -2
- data/app/views/lesli_shield/invites/_invite_actions.html.erb +34 -0
- data/app/views/lesli_shield/invites/_status_badge.html.erb +13 -0
- data/app/views/lesli_shield/invites/index.html.erb +119 -62
- data/app/views/lesli_shield/invites/new.html.erb +11 -36
- data/app/views/lesli_shield/invites/show.html.erb +13 -52
- data/app/views/lesli_shield/profiles/_information-form.html.erb +11 -0
- data/app/views/lesli_shield/profiles/_password-form.html.erb +68 -0
- data/app/views/lesli_shield/profiles/show.html.erb +26 -0
- data/app/views/lesli_shield/role/actions/_custom_actions.html.erb +24 -0
- data/app/views/lesli_shield/role/actions/_deployment_status.html.erb +14 -0
- data/app/views/lesli_shield/role/actions/_matrix.html.erb +69 -0
- data/app/views/lesli_shield/role/actions/_permissions.html.erb +95 -0
- data/app/views/lesli_shield/role/actions/_toggle.html.erb +34 -0
- data/app/views/lesli_shield/role/actions/index.html.erb +14 -10
- data/app/views/lesli_shield/roles/_deployment_badge.html.erb +15 -0
- data/app/views/lesli_shield/roles/_empty_state.html.erb +20 -0
- data/app/views/lesli_shield/roles/_field_errors.html.erb +5 -0
- data/app/views/lesli_shield/roles/_filters.html.erb +66 -0
- data/app/views/lesli_shield/roles/_form.html.erb +149 -18
- data/app/views/lesli_shield/roles/_management_menu.html.erb +37 -0
- data/app/views/lesli_shield/roles/_pagination.html.erb +43 -0
- data/app/views/lesli_shield/roles/_role_list.html.erb +116 -0
- data/app/views/lesli_shield/roles/_status_badge.html.erb +11 -0
- data/app/views/lesli_shield/roles/_type_badge.html.erb +9 -0
- data/app/views/lesli_shield/roles/index.html.erb +15 -38
- data/app/views/lesli_shield/roles/new.html.erb +11 -0
- data/app/views/lesli_shield/roles/show.html.erb +79 -7
- data/app/views/lesli_shield/users/_information-form.html.erb +15 -1
- data/app/views/users/invitations/show.html.erb +142 -0
- data/app/views/users/invitations/unavailable.html.erb +19 -0
- data/config/initializers/devise.rb +52 -328
- data/config/locales/devise.en.yml +8 -0
- data/config/locales/devise.es.yml +8 -0
- data/config/locales/translations.en.yml +314 -16
- data/config/locales/translations.es.yml +314 -16
- data/config/routes.rb +14 -3
- data/db/migrate/v1/0801120110_create_lesli_shield_invites.rb +40 -6
- data/lib/lesli_shield/engine.rb +42 -4
- data/lib/lesli_shield/router.rb +62 -18
- data/lib/lesli_shield/version.rb +2 -2
- data/lib/tasks/lesli_shield_tasks.rake +1 -1
- data/readme.md +17 -3
- metadata +63 -8
- data/app/assets/config/lesli_shield_manifest.js +0 -48
- data/app/assets/stylesheets/lesli_shield/application.tailwind.css +0 -2
- data/app/mailers/lesli_shield/invitation.html.erb +0 -23
- data/app/views/lesli_shield/invites/edit.html.erb +0 -12
- data/app/views/lesli_shield/role/actions/_form.html.erb +0 -75
|
@@ -33,11 +33,17 @@ Building a better future, one line of code at a time.
|
|
|
33
33
|
module LesliShield
|
|
34
34
|
class UserValidatorService < Lesli::ApplicationLesliService
|
|
35
35
|
|
|
36
|
-
def
|
|
36
|
+
def initialize(user)
|
|
37
|
+
raise ArgumentError, "user is required" unless user
|
|
38
|
+
|
|
39
|
+
super(user)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def validate
|
|
43
|
+
account_present?()
|
|
37
44
|
active?()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
active_roles?()
|
|
45
|
+
active_roles?() unless roles_empty?()
|
|
46
|
+
self
|
|
41
47
|
end
|
|
42
48
|
|
|
43
49
|
|
|
@@ -46,7 +52,7 @@ module LesliShield
|
|
|
46
52
|
def password_complexity(password)
|
|
47
53
|
|
|
48
54
|
if password.blank?
|
|
49
|
-
|
|
55
|
+
errors.push('error_password_cannot_be_blank')
|
|
50
56
|
return self
|
|
51
57
|
end
|
|
52
58
|
|
|
@@ -69,10 +75,10 @@ module LesliShield
|
|
|
69
75
|
password_settings = []
|
|
70
76
|
|
|
71
77
|
# get password settings from the database
|
|
72
|
-
if
|
|
78
|
+
if current_user.account
|
|
73
79
|
|
|
74
80
|
# if user is already registered
|
|
75
|
-
password_settings =
|
|
81
|
+
password_settings = current_user.account.settings.where(password_values.join(" or "))
|
|
76
82
|
|
|
77
83
|
elseif Account.first
|
|
78
84
|
|
|
@@ -85,7 +91,7 @@ module LesliShield
|
|
|
85
91
|
|
|
86
92
|
# exit validations if password complexity is not enabled
|
|
87
93
|
if settings[:name] == 'password_enforce_complexity' && settings[:value] != "1"
|
|
88
|
-
|
|
94
|
+
errors.clear
|
|
89
95
|
break
|
|
90
96
|
end
|
|
91
97
|
|
|
@@ -94,7 +100,7 @@ module LesliShield
|
|
|
94
100
|
|
|
95
101
|
# this regex removes all "normal" letters and numbers leaving special characters
|
|
96
102
|
if settings[:value].to_i > password.scan(/[^0-9A-Za-z]/).length
|
|
97
|
-
|
|
103
|
+
errors.push('error_password_special_char_count')
|
|
98
104
|
end
|
|
99
105
|
|
|
100
106
|
end
|
|
@@ -103,7 +109,7 @@ module LesliShield
|
|
|
103
109
|
if settings[:name] == 'password_lowercase_count'
|
|
104
110
|
|
|
105
111
|
if settings[:value].to_i > password_string_no_special.scan(/[^0-9A-Z]/).length
|
|
106
|
-
|
|
112
|
+
errors.push('error_password_lowercase_count')
|
|
107
113
|
end
|
|
108
114
|
|
|
109
115
|
end
|
|
@@ -112,7 +118,7 @@ module LesliShield
|
|
|
112
118
|
if settings[:name] == 'password_uppercase_count'
|
|
113
119
|
|
|
114
120
|
if settings[:value].to_i > password_string_no_special.scan(/[^0-9a-z]/).length
|
|
115
|
-
|
|
121
|
+
errors.push('error_password_uppercase_count')
|
|
116
122
|
end
|
|
117
123
|
|
|
118
124
|
end
|
|
@@ -121,7 +127,7 @@ module LesliShield
|
|
|
121
127
|
if settings[:name] == 'password_digit_count'
|
|
122
128
|
|
|
123
129
|
if settings[:value].to_i > password_string_no_special.scan(/[^A-Za-z]/).length
|
|
124
|
-
|
|
130
|
+
errors.push('error_password_digit_count')
|
|
125
131
|
end
|
|
126
132
|
|
|
127
133
|
end
|
|
@@ -130,7 +136,7 @@ module LesliShield
|
|
|
130
136
|
if settings[:name] == 'password_minimum_length'
|
|
131
137
|
|
|
132
138
|
if settings[:value].to_i > password.length
|
|
133
|
-
|
|
139
|
+
errors.push('error_password_minimum_length')
|
|
134
140
|
end
|
|
135
141
|
|
|
136
142
|
end
|
|
@@ -142,47 +148,45 @@ module LesliShield
|
|
|
142
148
|
end
|
|
143
149
|
|
|
144
150
|
def valid?
|
|
145
|
-
|
|
151
|
+
errors.empty?
|
|
146
152
|
end
|
|
147
153
|
|
|
148
154
|
private
|
|
149
155
|
|
|
150
|
-
|
|
151
|
-
#
|
|
152
|
-
def
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
# save a locked log for the requested user
|
|
157
|
-
log_failure("user_locked")
|
|
156
|
+
# Devise owns password, confirmation, and failed-attempt locking. This
|
|
157
|
+
# service contains only the additional access rules defined by Shield.
|
|
158
|
+
def account_present?
|
|
159
|
+
unless current_user.account.present?
|
|
160
|
+
log_failure("user_has_no_account")
|
|
158
161
|
|
|
159
162
|
return false
|
|
160
|
-
|
|
161
163
|
end
|
|
162
164
|
|
|
163
|
-
|
|
165
|
+
true
|
|
164
166
|
end
|
|
165
167
|
|
|
166
|
-
def confirmed?
|
|
167
168
|
|
|
168
|
-
|
|
169
|
-
|
|
169
|
+
# check if user is able to create a new session
|
|
170
|
+
def active?
|
|
171
|
+
temporarily_locked = current_user.locked_until.present? &&
|
|
172
|
+
current_user.locked_until > Time.current
|
|
170
173
|
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
unless current_user.active? && !temporarily_locked
|
|
175
|
+
|
|
176
|
+
# save a locked log for the requested user
|
|
177
|
+
log_failure("user_locked")
|
|
173
178
|
|
|
174
179
|
return false
|
|
175
180
|
|
|
176
181
|
end
|
|
177
182
|
|
|
178
183
|
return true
|
|
179
|
-
|
|
180
184
|
end
|
|
181
185
|
|
|
182
186
|
def roles_empty?
|
|
183
187
|
|
|
184
188
|
# check if user has roles assigned
|
|
185
|
-
|
|
189
|
+
unless current_user.roles.exists?
|
|
186
190
|
|
|
187
191
|
log_failure("user_has_no_assigned_role")
|
|
188
192
|
|
|
@@ -197,7 +201,7 @@ module LesliShield
|
|
|
197
201
|
def active_roles?
|
|
198
202
|
|
|
199
203
|
# check user has at least one active role before authorize the sign-in request
|
|
200
|
-
unless
|
|
204
|
+
unless current_user.roles.exists?(active: true)
|
|
201
205
|
log_failure("user_has_no_active_role")
|
|
202
206
|
|
|
203
207
|
return false
|
|
@@ -207,13 +211,7 @@ module LesliShield
|
|
|
207
211
|
end
|
|
208
212
|
|
|
209
213
|
def log_failure(description)
|
|
210
|
-
|
|
211
|
-
engine: LesliShield,
|
|
212
|
-
source: self.class.name,
|
|
213
|
-
action: "validate",
|
|
214
|
-
operation: "session_creation_failed",
|
|
215
|
-
description: description
|
|
216
|
-
)
|
|
214
|
+
errors.push(description) unless errors.include?(description)
|
|
217
215
|
end
|
|
218
216
|
end
|
|
219
217
|
end
|
|
@@ -1,16 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
<%= render(
|
|
2
|
+
"devise/shared/application-devise-simple",
|
|
3
|
+
title: I18n.t("lesli_shield.devise_confirmations.view_title")
|
|
4
|
+
) do %>
|
|
2
5
|
|
|
3
|
-
<%= form_for(
|
|
4
|
-
|
|
6
|
+
<%= form_for(
|
|
7
|
+
resource,
|
|
8
|
+
as: resource_name,
|
|
9
|
+
url: user_confirmation_path,
|
|
10
|
+
html: { method: :post, class: "text-left" },
|
|
11
|
+
builder: LesliView::Forms::Builder
|
|
12
|
+
) do |form| %>
|
|
5
13
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
<p class="mb-6 text-center text-sm leading-6 text-slate-600">
|
|
15
|
+
<%= I18n.t(
|
|
16
|
+
"lesli_shield.devise_confirmations.view_description"
|
|
17
|
+
) %>
|
|
18
|
+
</p>
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
21
|
+
|
|
22
|
+
<%= form.field_control_email(
|
|
23
|
+
:email,
|
|
24
|
+
icon: "mail",
|
|
25
|
+
label: I18n.t(
|
|
26
|
+
"lesli_shield.devise_confirmations.field_email"
|
|
27
|
+
),
|
|
28
|
+
message: resource.errors[:email].to_sentence.presence,
|
|
29
|
+
category: resource.errors[:email].any? ? :danger : nil,
|
|
30
|
+
value: resource.pending_reconfirmation? ?
|
|
31
|
+
resource.unconfirmed_email : resource.email,
|
|
32
|
+
required: true,
|
|
33
|
+
autofocus: true,
|
|
34
|
+
autocomplete: "email",
|
|
35
|
+
autocapitalize: "none",
|
|
36
|
+
spellcheck: false
|
|
37
|
+
) %>
|
|
15
38
|
|
|
16
|
-
<%=
|
|
39
|
+
<%= form.field_control_button(
|
|
40
|
+
I18n.t(
|
|
41
|
+
"lesli_shield.devise_confirmations.button_send_instructions"
|
|
42
|
+
),
|
|
43
|
+
{
|
|
44
|
+
class: "w-full",
|
|
45
|
+
data: {
|
|
46
|
+
turbo_submits_with: I18n.t(
|
|
47
|
+
"lesli_shield.devise_confirmations.button_sending"
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
icon: "mark_email_unread"
|
|
52
|
+
) %>
|
|
53
|
+
<% end %>
|
|
54
|
+
|
|
55
|
+
<%= render(
|
|
56
|
+
"devise/shared/links",
|
|
57
|
+
login: true,
|
|
58
|
+
password_reset: false,
|
|
59
|
+
magic_link: false,
|
|
60
|
+
otp: false
|
|
61
|
+
) %>
|
|
62
|
+
<% end %>
|
|
@@ -1,61 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
29
|
-
|
|
30
|
-
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
31
|
-
// ·
|
|
32
|
-
=end
|
|
33
|
-
%>
|
|
34
|
-
|
|
35
|
-
<% content_for :application_custom_assets do %>
|
|
36
|
-
<script>
|
|
37
|
-
//setTimeout(() => { window.location.href = "/"; }, 10000)
|
|
38
|
-
</script>
|
|
39
|
-
<% end %>
|
|
40
|
-
|
|
41
|
-
<%= render("devise/shared/application-devise-simple", title:"Account confirmation") do %>
|
|
42
|
-
|
|
43
|
-
<% if flash[:danger] %>
|
|
44
|
-
<% flash.each do |type, msg| %>
|
|
45
|
-
<div class="notification is-<%= type %>">
|
|
46
|
-
<%= msg %>
|
|
47
|
-
</div>
|
|
48
|
-
<% end %>
|
|
49
|
-
<% end %>
|
|
50
|
-
|
|
51
|
-
<% if flash[:success] %>
|
|
52
|
-
<div class="confirmation-message">
|
|
53
|
-
<p>Your account has been successfully verified</p>
|
|
54
|
-
</div>
|
|
55
|
-
<% end %>
|
|
56
|
-
|
|
57
|
-
<%= render("devise/shared/links", login:true) %>
|
|
58
|
-
|
|
1
|
+
<%= render(
|
|
2
|
+
"devise/shared/application-devise-simple",
|
|
3
|
+
title: I18n.t("lesli_shield.devise_confirmations.view_success_title")
|
|
4
|
+
) do %>
|
|
5
|
+
<section
|
|
6
|
+
class="my-8 w-full max-w-lg rounded-xl border border-emerald-200 bg-white p-8 text-center shadow-sm"
|
|
7
|
+
role="status"
|
|
8
|
+
>
|
|
9
|
+
<span
|
|
10
|
+
class="material-symbols-outlined text-5xl text-emerald-600"
|
|
11
|
+
aria-hidden="true"
|
|
12
|
+
>
|
|
13
|
+
verified
|
|
14
|
+
</span>
|
|
15
|
+
|
|
16
|
+
<p class="mt-4 text-sm leading-6 text-slate-600">
|
|
17
|
+
<%= I18n.t(
|
|
18
|
+
"lesli_shield.devise_confirmations.view_success_description"
|
|
19
|
+
) %>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
<%= link_to(
|
|
23
|
+
I18n.t("lesli_shield.devise_shared.button_login"),
|
|
24
|
+
new_user_session_path,
|
|
25
|
+
class: "mt-6 inline-flex min-h-11 items-center justify-center rounded-lg bg-[var(--lesli-color-primary)] px-5 py-2.5 text-sm font-semibold text-white transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--lesli-color-primary)]"
|
|
26
|
+
) %>
|
|
27
|
+
</section>
|
|
59
28
|
<% end %>
|
|
60
|
-
|
|
61
|
-
|
|
@@ -1,36 +1,70 @@
|
|
|
1
|
-
<%= render(
|
|
1
|
+
<%= render(
|
|
2
|
+
"devise/shared/application-devise-simple",
|
|
3
|
+
title: I18n.t("lesli_shield.devise_passwords.view_update_title")
|
|
4
|
+
) do %>
|
|
2
5
|
|
|
3
6
|
<%= form_for(
|
|
4
|
-
resource,
|
|
5
|
-
as: resource_name,
|
|
6
|
-
url: user_password_path
|
|
7
|
-
html: { class: "
|
|
7
|
+
resource,
|
|
8
|
+
as: resource_name,
|
|
9
|
+
url: user_password_path,
|
|
10
|
+
html: { class: "text-left", method: :put },
|
|
8
11
|
builder: LesliView::Forms::Builder
|
|
9
|
-
|
|
12
|
+
) do |form| %>
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
<p class="mb-6 text-center text-sm leading-6 text-slate-600">
|
|
15
|
+
<%= I18n.t("lesli_shield.devise_passwords.view_update_description") %>
|
|
16
|
+
</p>
|
|
12
17
|
|
|
13
|
-
|
|
14
|
-
label_html:form.label(:password),
|
|
15
|
-
control_html:form.password_field(:password, autocomplete: "current-password", placeholder: "* * * * * *"),
|
|
16
|
-
message_text: flash.first&.second,
|
|
17
|
-
category: flash.first&.first,
|
|
18
|
-
icon: "key"
|
|
19
|
-
) %>
|
|
18
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
label_html:form.label(:password_confirmation),
|
|
23
|
-
control_html:form.password_field(:password_confirmation, autocomplete: "current-password", placeholder: "* * * * * *"),
|
|
24
|
-
message_text: flash.first&.second,
|
|
25
|
-
category: flash.first&.first,
|
|
26
|
-
icon: "key"
|
|
27
|
-
) %>
|
|
20
|
+
<%= form.hidden_field :reset_password_token %>
|
|
28
21
|
|
|
29
|
-
|
|
22
|
+
<%= form.field_control_password(
|
|
23
|
+
:password,
|
|
24
|
+
icon: "key",
|
|
25
|
+
label: I18n.t("lesli_shield.devise_passwords.field_password"),
|
|
26
|
+
message: I18n.t(
|
|
27
|
+
"lesli_shield.devise_passwords.field_password_hint_#{@minimum_password_length == 1 ? 'one' : 'other'}",
|
|
28
|
+
count: @minimum_password_length
|
|
29
|
+
),
|
|
30
|
+
required: true,
|
|
31
|
+
autofocus: true,
|
|
32
|
+
autocomplete: "new-password",
|
|
33
|
+
minlength: @minimum_password_length,
|
|
34
|
+
value: ""
|
|
35
|
+
) %>
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
<%= form.field_control_password(
|
|
38
|
+
:password_confirmation,
|
|
39
|
+
icon: "key",
|
|
40
|
+
label: I18n.t(
|
|
41
|
+
"lesli_shield.devise_passwords.field_password_confirmation"
|
|
42
|
+
),
|
|
43
|
+
required: true,
|
|
44
|
+
autocomplete: "new-password",
|
|
45
|
+
minlength: @minimum_password_length,
|
|
46
|
+
value: ""
|
|
47
|
+
) %>
|
|
32
48
|
|
|
33
|
-
|
|
49
|
+
<%= form.field_control_button(
|
|
50
|
+
I18n.t("lesli_shield.devise_passwords.button_update_password"),
|
|
51
|
+
{
|
|
52
|
+
class: "is-fullwidth",
|
|
53
|
+
data: {
|
|
54
|
+
turbo_submits_with: I18n.t(
|
|
55
|
+
"lesli_shield.devise_passwords.button_updating"
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
icon: "key"
|
|
60
|
+
) %>
|
|
61
|
+
<% end %>
|
|
34
62
|
|
|
35
|
-
<%= render(
|
|
63
|
+
<%= render(
|
|
64
|
+
"devise/shared/links",
|
|
65
|
+
login: true,
|
|
66
|
+
password_reset: false,
|
|
67
|
+
magic_link: false,
|
|
68
|
+
otp: false
|
|
69
|
+
) %>
|
|
36
70
|
<% end %>
|
|
@@ -1,33 +1,68 @@
|
|
|
1
1
|
|
|
2
|
-
<%= render(
|
|
2
|
+
<%= render(
|
|
3
|
+
"devise/shared/application-devise-simple",
|
|
4
|
+
title: I18n.t("lesli_shield.devise_passwords.view_request_title")
|
|
5
|
+
) do %>
|
|
3
6
|
|
|
4
7
|
<%= form_for(
|
|
5
|
-
resource,
|
|
6
|
-
as: resource_name,
|
|
7
|
-
url: user_password_path
|
|
8
|
-
html: { class: "
|
|
8
|
+
resource,
|
|
9
|
+
as: resource_name,
|
|
10
|
+
url: user_password_path,
|
|
11
|
+
html: { class: "text-left" },
|
|
9
12
|
builder: LesliView::Forms::Builder
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
13
|
+
) do |form| %>
|
|
14
|
+
|
|
15
|
+
<p class="mb-6 text-center text-sm leading-6 text-slate-600">
|
|
16
|
+
<%= I18n.t("lesli_shield.devise_passwords.view_request_description") %>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
|
20
|
+
|
|
21
|
+
<%= form.field_control_email(
|
|
22
|
+
:email,
|
|
23
|
+
icon: "mail",
|
|
24
|
+
label: I18n.t("lesli_shield.devise_passwords.field_email"),
|
|
25
|
+
required: true,
|
|
26
|
+
autofocus: true,
|
|
27
|
+
autocomplete: "email",
|
|
28
|
+
autocapitalize: "none",
|
|
29
|
+
spellcheck: false
|
|
30
|
+
) %>
|
|
31
|
+
|
|
32
|
+
<%= form.field_control_button(
|
|
33
|
+
I18n.t("lesli_shield.devise_passwords.button_send_instructions"),
|
|
34
|
+
{
|
|
35
|
+
class: "is-fullwidth",
|
|
36
|
+
data: {
|
|
37
|
+
turbo_submits_with: I18n.t(
|
|
38
|
+
"lesli_shield.devise_passwords.button_sending"
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
icon: "mail"
|
|
43
|
+
) %>
|
|
44
|
+
|
|
45
|
+
<% if Lesli.config.security.dig(:allow_registration) %>
|
|
46
|
+
<p class="mt-6 text-center text-sm text-slate-600">
|
|
47
|
+
<%= I18n.t(
|
|
48
|
+
"lesli_shield.devise_sessions.view_still_not_registered"
|
|
49
|
+
) %>
|
|
50
|
+
<%= link_to(
|
|
51
|
+
I18n.t(
|
|
52
|
+
"lesli_shield.devise_registrations.button_create_account"
|
|
53
|
+
),
|
|
54
|
+
new_user_registration_path,
|
|
55
|
+
class: "font-semibold text-[var(--lesli-color-primary)] underline underline-offset-2 hover:opacity-80 focus-visible:rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--lesli-color-primary)]"
|
|
56
|
+
) %>
|
|
57
|
+
</p>
|
|
30
58
|
<% end %>
|
|
59
|
+
<% end %>
|
|
31
60
|
|
|
32
|
-
<%= render(
|
|
61
|
+
<%= render(
|
|
62
|
+
"devise/shared/links",
|
|
63
|
+
login: true,
|
|
64
|
+
password_reset: false,
|
|
65
|
+
magic_link: false,
|
|
66
|
+
otp: false
|
|
67
|
+
) %>
|
|
33
68
|
<% end %>
|