lesli_shield 1.1.3 → 1.1.4
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/app/assets/stylesheets/lesli_shield/confirmations.css +18960 -1
- data/app/assets/stylesheets/lesli_shield/devise/oauth.css +32 -0
- data/app/assets/stylesheets/lesli_shield/passwords.css +18913 -1
- data/app/assets/stylesheets/lesli_shield/registrations.css +19001 -1
- data/app/assets/stylesheets/lesli_shield/sessions.css +19001 -1
- data/app/assets/stylesheets/lesli_shield/users.css +30 -0
- data/app/controllers/users/sessions_controller.rb +1 -1
- data/app/services/lesli_shield/user_registration_service.rb +8 -13
- data/app/views/devise/registrations/new.html.erb +14 -14
- data/app/views/devise/sessions/new.html.erb +9 -4
- data/app/views/devise/shared/_application-devise.html.erb +0 -1
- data/config/locales/translations.en.yml +14 -0
- data/config/locales/translations.es.yml +14 -0
- data/lib/lesli_shield/version.rb +2 -2
- metadata +1 -4
- data/config/locales/translations.fr.yml +0 -2
- data/config/locales/translations.it.yml +0 -5
- data/config/locales/translations.pt.yml +0 -2
|
@@ -1 +1,31 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/*
|
|
3
|
+
Lesli
|
|
1
4
|
|
|
5
|
+
Copyright (c) 2023, Lesli Technologies, S. A.
|
|
6
|
+
|
|
7
|
+
This program is free software: you can redistribute it and/or modify
|
|
8
|
+
it under the terms of the GNU General Public License as published by
|
|
9
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
(at your option) any later version.
|
|
11
|
+
|
|
12
|
+
This program is distributed in the hope that it will be useful,
|
|
13
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
GNU General Public License for more details.
|
|
16
|
+
|
|
17
|
+
You should have received a copy of the GNU General Public License
|
|
18
|
+
along with this program. If not, see http://www.gnu.org/licenses/.
|
|
19
|
+
|
|
20
|
+
Lesli · Ruby on Rails SaaS Development Framework.
|
|
21
|
+
|
|
22
|
+
Made with ♥ by https://www.lesli.tech
|
|
23
|
+
Building a better future, one line of code at a time.
|
|
24
|
+
|
|
25
|
+
@contact hello@lesli.tech
|
|
26
|
+
@website https://www.lesli.tech
|
|
27
|
+
@license GPLv3 http://www.gnu.org/licenses/gpl-3.0.en.html
|
|
28
|
+
|
|
29
|
+
// · ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~ ~·~
|
|
30
|
+
// ·
|
|
31
|
+
*/
|
|
@@ -126,7 +126,7 @@ class Users::SessionsController < Devise::SessionsController
|
|
|
126
126
|
# Ensures it's a local path
|
|
127
127
|
return redirect_path if uri.relative?
|
|
128
128
|
end
|
|
129
|
-
Lesli.config.path_after_login || root_path
|
|
129
|
+
Lesli.config.shield.dig(:path_after_login) || root_path
|
|
130
130
|
rescue URI::InvalidURIError
|
|
131
131
|
# If the URL is invalid, fallback to root
|
|
132
132
|
root_path
|
|
@@ -59,36 +59,31 @@ module LesliShield
|
|
|
59
59
|
# check if instance is for multi-account
|
|
60
60
|
allow_multiaccount = Lesli.config.security.dig(:allow_multiaccount)
|
|
61
61
|
|
|
62
|
-
# create new account for the new user only if multi-account is allowed
|
|
63
62
|
if allow_multiaccount === true
|
|
63
|
+
# create new account for the new user only if multi-account is allowed
|
|
64
64
|
account = Lesli::Account.create!({
|
|
65
65
|
user: resource, # set user as owner of his just created account
|
|
66
66
|
name: "Lesli", # temporary company name
|
|
67
67
|
email: resource.email,
|
|
68
68
|
status: :active # account is active due user already confirmed his email
|
|
69
69
|
})
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
# if multi-account is not allowed user belongs to the first account in instance
|
|
73
|
-
if allow_multiaccount === false
|
|
70
|
+
else
|
|
71
|
+
# if multi-account is not allowed user belongs to the first account in instance
|
|
74
72
|
account = Lesli::Account.first
|
|
75
73
|
end
|
|
76
74
|
|
|
77
75
|
# add user to his own account
|
|
78
76
|
resource.account = account
|
|
79
|
-
|
|
80
|
-
# add owner role to user only if multi-account is allowed
|
|
77
|
+
|
|
81
78
|
if allow_multiaccount == true
|
|
79
|
+
# add owner role to user only if multi-account is allowed
|
|
82
80
|
resource.user_roles.create({ role: account.roles.find_by(name: "owner") })
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
# add profile role to user only if multi-account is allowed
|
|
86
|
-
if allow_multiaccount == false
|
|
81
|
+
else
|
|
87
82
|
# Assigning default role if defined in account settings
|
|
88
83
|
# Otherwise, the default role is "limited"
|
|
89
84
|
#default_role_id = account.settings.find_by(:name => "default_role_id")&.value
|
|
90
|
-
default_role_id =
|
|
91
|
-
|
|
85
|
+
default_role_id = Lesli.config.shield.dig(:default_role)
|
|
86
|
+
|
|
92
87
|
if default_role_id.present?
|
|
93
88
|
resource.roles.create({ role: account.roles.find_by(:id => default_role_id)})
|
|
94
89
|
else
|
|
@@ -38,7 +38,12 @@ if Lesli.config.demo
|
|
|
38
38
|
end
|
|
39
39
|
%>
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
<%
|
|
42
|
+
title = I18n.t("overrides.lesli_shield.devise/registrations.view_title",
|
|
43
|
+
default: :"lesli_shield.devise/registrations.view_title")
|
|
44
|
+
%>
|
|
45
|
+
|
|
46
|
+
<%= render("devise/shared/application-devise", title:title) do %>
|
|
42
47
|
|
|
43
48
|
<%= form_for(
|
|
44
49
|
resource,
|
|
@@ -63,17 +68,11 @@ end
|
|
|
63
68
|
) %>
|
|
64
69
|
|
|
65
70
|
<div class="field mb-5">
|
|
66
|
-
<p
|
|
71
|
+
<p><%= I18n.t("lesli_shield.devise/registrations.view_password_requirements") %></p>
|
|
67
72
|
<ul class="pl-3 password-requirements">
|
|
68
|
-
<li>
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
<li>
|
|
72
|
-
• One symbol
|
|
73
|
-
</li>
|
|
74
|
-
<li>
|
|
75
|
-
• One number
|
|
76
|
-
</li>
|
|
73
|
+
<li>• <%= I18n.t("lesli_shield.devise/registrations.view_password_requirements_uppercase") %></li>
|
|
74
|
+
<li>• <%= I18n.t("lesli_shield.dashboards.view_password_requirements_symbol") %></li>
|
|
75
|
+
<li>• <%= I18n.t("lesli_shield.dashboards.view_password_requirements_number") %></li>
|
|
77
76
|
</ul>
|
|
78
77
|
</div>
|
|
79
78
|
|
|
@@ -89,15 +88,16 @@ end
|
|
|
89
88
|
<button
|
|
90
89
|
type="submit"
|
|
91
90
|
class="button is-primary is-fullwidth mb-2">
|
|
92
|
-
|
|
91
|
+
<%= I18n.t("overrides.lesli_shield.devise/registrations.button_create_account",
|
|
92
|
+
default: :"lesli_shield.devise/registrations.button_create_account") %>
|
|
93
93
|
</button>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
96
96
|
|
|
97
97
|
<p class="account has-text-centered">
|
|
98
|
-
|
|
98
|
+
<%= I18n.t("lesli_shield.devise/registrations.view_already_have_an_account") %>
|
|
99
99
|
<%= link_to(new_user_session_path, :class => "has-text-primary") do %>
|
|
100
|
-
<u><b
|
|
100
|
+
<u><b><%= I18n.t("lesli_shield.devise/registrations.button_login") %></b></u>
|
|
101
101
|
<% end %>
|
|
102
102
|
</p>
|
|
103
103
|
<% end %>
|
|
@@ -39,7 +39,12 @@ if Lesli.config.demo
|
|
|
39
39
|
end
|
|
40
40
|
%>
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
<%
|
|
43
|
+
title = I18n.t("overrides.lesli_shield.devise/sessions.view_title",
|
|
44
|
+
default: :"lesli_shield.devise/sessions.view_title")
|
|
45
|
+
%>
|
|
46
|
+
|
|
47
|
+
<%= render("devise/shared/application-devise", title:title) do %>
|
|
43
48
|
|
|
44
49
|
<%= form_for(
|
|
45
50
|
resource,
|
|
@@ -77,16 +82,16 @@ end
|
|
|
77
82
|
<button
|
|
78
83
|
type="submit"
|
|
79
84
|
class="button is-primary is-fullwidth mb-2">
|
|
80
|
-
|
|
85
|
+
<%= I18n.t("lesli_shield.devise/sessions.button_log_in") %>
|
|
81
86
|
</button>
|
|
82
87
|
</div>
|
|
83
88
|
</div>
|
|
84
89
|
|
|
85
90
|
<% if Lesli.config.security.dig(:allow_registration) %>
|
|
86
91
|
<p class="account has-text-centered">
|
|
87
|
-
|
|
92
|
+
<%= I18n.t("lesli_shield.devise/sessions.view_still_not_registered") %>
|
|
88
93
|
<%= link_to(new_user_registration_path, :class => "has-text-primary") do %>
|
|
89
|
-
<u><b
|
|
94
|
+
<u><b><%= I18n.t("lesli_shield.devise/sessions.button_create_account") %></b></u>
|
|
90
95
|
<% end %>
|
|
91
96
|
</p>
|
|
92
97
|
<% end %>
|
|
@@ -3,3 +3,17 @@
|
|
|
3
3
|
lesli_shield:
|
|
4
4
|
devise/sessions:
|
|
5
5
|
message_not_valid_credentials: Not valid credentials
|
|
6
|
+
view_title: Welcome to Lesli
|
|
7
|
+
button_log_in: Log in
|
|
8
|
+
view_still_not_registered: Still not registered?
|
|
9
|
+
button_create_account: Create account
|
|
10
|
+
devise/registrations:
|
|
11
|
+
view_title: Create an account to discover Lesli
|
|
12
|
+
view_password_requirements: 'Password needs to contain:'
|
|
13
|
+
view_password_requirements_uppercase: 'Minimum one uppercase letter '
|
|
14
|
+
button_create_account: Create account
|
|
15
|
+
view_already_have_an_account: Already have an account?
|
|
16
|
+
button_login: Log in
|
|
17
|
+
dashboards:
|
|
18
|
+
view_password_requirements_symbol: One symbol
|
|
19
|
+
view_password_requirements_number: One number
|
|
@@ -3,3 +3,17 @@
|
|
|
3
3
|
lesli_shield:
|
|
4
4
|
devise/sessions:
|
|
5
5
|
message_not_valid_credentials: Credenciales no validas
|
|
6
|
+
view_title: ":lesli_shield.devise/sessions.view_title:"
|
|
7
|
+
button_log_in: Iniciar sesión
|
|
8
|
+
view_still_not_registered: "¿Aún no tienes cuenta?"
|
|
9
|
+
button_create_account: Crear cuenta
|
|
10
|
+
devise/registrations:
|
|
11
|
+
view_title: Crea una cuenta y descubre Lesli
|
|
12
|
+
view_password_requirements: 'La contraseña debe incluir:'
|
|
13
|
+
view_password_requirements_uppercase: Una letra mayuscula
|
|
14
|
+
button_create_account: Crear cuenta
|
|
15
|
+
view_already_have_an_account: "¿Ya tienes cuenta?"
|
|
16
|
+
button_login: Iniciar sesión
|
|
17
|
+
dashboards:
|
|
18
|
+
view_password_requirements_symbol: Un caracter especial
|
|
19
|
+
view_password_requirements_number: Un número
|
data/lib/lesli_shield/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lesli_shield
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.1.
|
|
4
|
+
version: 1.1.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- The Lesli Development Team
|
|
@@ -163,9 +163,6 @@ files:
|
|
|
163
163
|
- config/initializers/devise.rb
|
|
164
164
|
- config/locales/translations.en.yml
|
|
165
165
|
- config/locales/translations.es.yml
|
|
166
|
-
- config/locales/translations.fr.yml
|
|
167
|
-
- config/locales/translations.it.yml
|
|
168
|
-
- config/locales/translations.pt.yml
|
|
169
166
|
- config/routes.rb
|
|
170
167
|
- db/migrate/v1/0801000110_create_lesli_shield_accounts.rb
|
|
171
168
|
- db/migrate/v1/0801100210_create_lesli_shield_role_actions.rb
|