alchemy-devise 7.1.2 → 7.3.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 +10 -0
- data/app/assets/builds/alchemy-devise.css +1 -0
- data/app/assets/builds/alchemy-devise.css.map +1 -0
- data/app/assets/stylesheets/alchemy-devise/login.scss +5 -5
- data/app/assets/stylesheets/alchemy-devise.scss +1 -2
- data/app/models/alchemy/user.rb +4 -0
- data/app/views/alchemy/admin/passwords/edit.html.erb +4 -0
- data/app/views/alchemy/admin/passwords/new.html.erb +4 -0
- data/app/views/alchemy/admin/user_sessions/new.html.erb +5 -9
- data/app/views/alchemy/admin/users/_resource_table.html.erb +34 -0
- data/app/views/alchemy/admin/users/_table.html.erb +28 -0
- data/app/views/alchemy/admin/users/index.html.erb +10 -29
- data/app/views/alchemy/admin/users/signup.html.erb +4 -0
- data/lib/alchemy/devise/version.rb +1 -1
- data/lib/generators/alchemy/devise/install/install_generator.rb +0 -6
- data/lib/generators/alchemy/devise/install/templates/devise.rb.tt +25 -11
- metadata +15 -25
- data/app/assets/stylesheets/alchemy/admin/alchemy-devise.css +0 -3
- data/app/assets/stylesheets/alchemy-devise/users.scss +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50fb7555da0609c974b6455982abcc8cd18e023ab14bca6c8d925c698edca6a5
|
4
|
+
data.tar.gz: b5e00e701e89fbd07b9f63886562e0ada6e0daeba1b7c53787b91d0fb65bc844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf3b05ce4e55d5bcedd941acbb7736a1ffe3b377d52c4084ee0bf61b387c9bc343cf07d3f21e2fa4362693fdddd3a8d7c643b71fe2d83117acfe95c43cfec90c
|
7
|
+
data.tar.gz: bea6ab34bc7216a89a835fa916dbe08b03ebb5e66db087e1cd9d38908722971cb909e370581bf0ddab822dbc5434370c1637973822d29c4391890899c3024d15
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.3.0 (2024-09-06)
|
4
|
+
|
5
|
+
- Use new resource_table component for user list [#213](https://github.com/AlchemyCMS/alchemy-devise/pull/213) ([tvdeyen](https://github.com/tvdeyen))
|
6
|
+
- Compile CSS into Gem [#211](https://github.com/AlchemyCMS/alchemy-devise/pull/211) ([tvdeyen](https://github.com/tvdeyen))
|
7
|
+
|
8
|
+
## 7.2.0 (2024-06-07)
|
9
|
+
|
10
|
+
- Update Devise config for Turbo [#209](https://github.com/AlchemyCMS/alchemy-devise/pull/209) ([tvdeyen](https://github.com/tvdeyen))
|
11
|
+
- Disable Turbo Drive on login form [#203](https://github.com/AlchemyCMS/alchemy-devise/pull/203) ([tvdeyen](https://github.com/tvdeyen))
|
12
|
+
|
3
13
|
## 7.1.2 (2024-02-29)
|
4
14
|
|
5
15
|
- Allow setting a layout for user_sessions and passwords controller [#127](https://github.com/AlchemyCMS/alchemy-devise/pull/127) ([robinboening](https://github.com/robinboening))
|
@@ -0,0 +1 @@
|
|
1
|
+
body.user_sessions,body.passwords{background-color:var(--color-blue_dark);color:var(--color-white)}body.user_sessions a,body.passwords a{color:var(--color-white)}body.user_sessions #errors,body.user_sessions .message.info,body.passwords #errors,body.passwords .message.info{border-color:rgba(0,0,0,0)}body.user_sessions #errors,body.passwords #errors{margin-left:157px}#logo{width:275px;height:auto;margin:0 0 1em 164px}.login_signup_box{position:absolute;width:450px;top:50%;left:50%;transform:translate(-60%, -50%)}.no-js .login_signup_box{display:none}.login_signup_box .message{margin-left:157px}.login_signup_box .link{text-align:right}.login_signup_box button.secondary{color:var(--color-white);border-color:var(--color-white)}form.user_roles .checkbox{display:inline-block;width:50%}/*# sourceMappingURL=alchemy-devise.css.map */
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sourceRoot":"","sources":["../stylesheets/alchemy-devise/login.scss","../stylesheets/alchemy-devise/users.scss"],"names":[],"mappings":"AAAA,kCAEE,wCACA,yBAEA,sCACE,yBAGF,gHAEE,2BAGF,kDACE,kBAIJ,MACE,YACA,YACA,qBAGF,kBACE,kBACA,YACA,QACA,SACA,gCAEA,yBACE,aAGF,2BACE,kBAGF,wBACE,iBAGF,mCACE,yBACA,gCC5CF,0BACE,qBACA","file":"alchemy-devise.css"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
body.user_sessions,
|
2
2
|
body.passwords {
|
3
|
-
background-color:
|
4
|
-
color:
|
3
|
+
background-color: var(--color-blue_dark);
|
4
|
+
color: var(--color-white);
|
5
5
|
|
6
6
|
a {
|
7
|
-
color:
|
7
|
+
color: var(--color-white);
|
8
8
|
}
|
9
9
|
|
10
10
|
#errors,
|
@@ -43,7 +43,7 @@ body.passwords {
|
|
43
43
|
}
|
44
44
|
|
45
45
|
button.secondary {
|
46
|
-
color:
|
47
|
-
border-color:
|
46
|
+
color: var(--color-white);
|
47
|
+
border-color: var(--color-white);
|
48
48
|
}
|
49
49
|
}
|
@@ -1,2 +1 @@
|
|
1
|
-
@import "alchemy/
|
2
|
-
@import "alchemy-devise/*";
|
1
|
+
@import "alchemy-devise/login";
|
data/app/models/alchemy/user.rb
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
<%= content_for :stylesheets do %>
|
2
|
+
<%= stylesheet_link_tag "alchemy-devise" %>
|
3
|
+
<% end %>
|
4
|
+
|
1
5
|
<div class="login_signup_box">
|
2
6
|
<%= image_tag 'alchemy/alchemy-logo.svg', id: 'logo' %>
|
3
|
-
<%= alchemy_form_for :user, url: {action: 'create'}, id: 'login' do |f| %>
|
7
|
+
<%= alchemy_form_for :user, url: {action: 'create'}, id: 'login', data: { turbo: false } do |f| %>
|
4
8
|
<%= f.input Devise.authentication_keys.first, autofocus: true %>
|
5
9
|
<%= f.input :password %>
|
6
10
|
<div class="input link">
|
@@ -13,11 +17,3 @@
|
|
13
17
|
</div>
|
14
18
|
<% end %>
|
15
19
|
</div>
|
16
|
-
|
17
|
-
<%- content_for :javascripts do -%>
|
18
|
-
<script type="text/javascript" charset="utf-8">
|
19
|
-
jQuery(function($) {
|
20
|
-
$('#user_login').focus();
|
21
|
-
});
|
22
|
-
</script>
|
23
|
-
<%- end -%>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<%= render Alchemy::Admin::Resource::Table.new(@users, query: @query) do |table| %>
|
2
|
+
<% table.icon_column do |user| %>
|
3
|
+
<%= render_icon(:user, style: user.logged_in? ? "solid" : "regular") %>
|
4
|
+
<% end %>
|
5
|
+
<% table.column :login, sortable: true do |user| %>
|
6
|
+
<% if can?(:edit, user) %>
|
7
|
+
<%= link_to_dialog user.login,
|
8
|
+
alchemy.edit_admin_user_path(user), {
|
9
|
+
title: Alchemy.t(:edit_user),
|
10
|
+
overflow: true,
|
11
|
+
size: "430x560"
|
12
|
+
},
|
13
|
+
title: Alchemy.t(:edit_user) %>
|
14
|
+
<% else %>
|
15
|
+
<%= user.login %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
<% table.column :firstname, class_name: "name", sortable: true %>
|
19
|
+
<% table.column :lastname, sortable: true %>
|
20
|
+
<% table.column :email, sortable: true %>
|
21
|
+
<% table.column :language do |user| %>
|
22
|
+
<%= Alchemy.t(user.language, scope: :translations, default: Alchemy.t(:unknown)) %>
|
23
|
+
<% end %>
|
24
|
+
<% table.column :last_sign_in_at, sortable: true do |user| %>
|
25
|
+
<%= user.last_sign_in_at.present? ? l(user.last_sign_in_at, format: :"alchemy.default") : Alchemy.t(:unknown) %>
|
26
|
+
<% end %>
|
27
|
+
<% table.column :role, header: Alchemy::User.human_attribute_name(:alchemy_roles) do |user| %>
|
28
|
+
<%= user.human_roles_string %>
|
29
|
+
<% end %>
|
30
|
+
<% table.delete_button tooltip: Alchemy.t(:delete_user), confirm_message: Alchemy.t(:confirm_to_delete_user) %>
|
31
|
+
<% table.edit_button tooltip: Alchemy.t(:edit_user), dialog_size: "430x560" %>
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
<%= paginate @users, theme: "alchemy" %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<table class="list" id="user_list">
|
2
|
+
<thead>
|
3
|
+
<tr>
|
4
|
+
<th class="icon"></th>
|
5
|
+
<th class="login">
|
6
|
+
<%= sort_link @query, :login, hide_indicator: true %>
|
7
|
+
</th>
|
8
|
+
<th class="name">
|
9
|
+
<%= sort_link @query, :firstname, hide_indicator: true %>
|
10
|
+
</th>
|
11
|
+
<th>
|
12
|
+
<%= sort_link @query, :lastname, hide_indicator: true %>
|
13
|
+
</th>
|
14
|
+
<th class="email">
|
15
|
+
<%= sort_link @query, :email, hide_indicator: true %>
|
16
|
+
</th>
|
17
|
+
<th><%= Alchemy::User.human_attribute_name('language') %></th>
|
18
|
+
<th>
|
19
|
+
<%= sort_link @query, :last_sign_in_at, hide_indicator: true %>
|
20
|
+
</th>
|
21
|
+
<th class="role"><%= Alchemy::User.human_attribute_name('roles') %></th>
|
22
|
+
<th class="tools"></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<%= render partial: "user", collection: @users %>
|
27
|
+
</tbody>
|
28
|
+
</table>
|
@@ -1,3 +1,7 @@
|
|
1
|
+
<%= content_for :stylesheets do %>
|
2
|
+
<%= stylesheet_link_tag "alchemy-devise" %>
|
3
|
+
<% end %>
|
4
|
+
|
1
5
|
<%= content_for :toolbar do %>
|
2
6
|
<%= toolbar_button(
|
3
7
|
icon: :plus,
|
@@ -16,37 +20,14 @@
|
|
16
20
|
<% end %>
|
17
21
|
|
18
22
|
<div id="archive_all" class="resources-table-wrapper">
|
19
|
-
<%= render "alchemy/admin/resources/table_header" %>
|
20
23
|
<% if @users.any? %>
|
24
|
+
<%= render "alchemy/admin/resources/table_header" %>
|
21
25
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
<%= sort_link @query, :login, hide_indicator: true %>
|
28
|
-
</th>
|
29
|
-
<th class="name">
|
30
|
-
<%= sort_link @query, :firstname, hide_indicator: true %>
|
31
|
-
</th>
|
32
|
-
<th>
|
33
|
-
<%= sort_link @query, :lastname, hide_indicator: true %>
|
34
|
-
</th>
|
35
|
-
<th class="email">
|
36
|
-
<%= sort_link @query, :email, hide_indicator: true %>
|
37
|
-
</th>
|
38
|
-
<th><%= Alchemy::User.human_attribute_name('language') %></th>
|
39
|
-
<th>
|
40
|
-
<%= sort_link @query, :last_sign_in_at, hide_indicator: true %>
|
41
|
-
</th>
|
42
|
-
<th class="role"><%= Alchemy::User.human_attribute_name('roles') %></th>
|
43
|
-
<th class="tools"></th>
|
44
|
-
</tr>
|
45
|
-
</thead>
|
46
|
-
<tbody>
|
47
|
-
<%= render partial: 'alchemy/admin/users/user', collection: @users %>
|
48
|
-
</tbody>
|
49
|
-
</table>
|
26
|
+
<% if Alchemy::Admin.const_defined?(:Resource) %>
|
27
|
+
<%= render "resource_table" %>
|
28
|
+
<% else %>
|
29
|
+
<%= render "table" %>
|
30
|
+
<% end %>
|
50
31
|
|
51
32
|
<%= paginate @users, theme: 'alchemy' %>
|
52
33
|
|
@@ -16,12 +16,6 @@ module Alchemy
|
|
16
16
|
def run_migrations
|
17
17
|
run "bundle exec rake db:migrate"
|
18
18
|
end
|
19
|
-
|
20
|
-
def append_assets
|
21
|
-
insert_into_file "vendor/assets/stylesheets/alchemy/admin/all.css",
|
22
|
-
"\n *= require alchemy/admin/alchemy-devise",
|
23
|
-
after: " *= require alchemy/admin"
|
24
|
-
end
|
25
19
|
end
|
26
20
|
end
|
27
21
|
end
|
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# Assuming you have not yet modified this file, each configuration option below
|
4
|
+
# is set to its default value. Note that some are commented out while others
|
5
|
+
# are not: uncommented lines are intended to protect your configuration from
|
6
|
+
# breaking changes in upgrades (i.e., in the event that future versions of
|
7
|
+
# Devise change the default values for those options).
|
8
|
+
#
|
3
9
|
# Use this hook to configure devise mailer, warden hooks and so forth.
|
4
10
|
# Many of these configuration options can be set straight in your model.
|
5
11
|
Devise.setup do |config|
|
@@ -68,7 +74,10 @@ Devise.setup do |config|
|
|
68
74
|
# Tell if authentication through HTTP Auth is enabled. False by default.
|
69
75
|
# It can be set to an array that will enable http authentication only for the
|
70
76
|
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
71
|
-
# enable it only for database authentication.
|
77
|
+
# enable it only for database authentication.
|
78
|
+
# For API-only applications to support authentication "out-of-the-box", you will likely want to
|
79
|
+
# enable this with :database unless you are using a custom strategy.
|
80
|
+
# The supported strategies are:
|
72
81
|
# :database = Support basic authentication with authentication key + password
|
73
82
|
config.http_authenticatable = true
|
74
83
|
|
@@ -103,15 +112,18 @@ Devise.setup do |config|
|
|
103
112
|
# config.reload_routes = true
|
104
113
|
|
105
114
|
# ==> Configuration for :database_authenticatable
|
106
|
-
# For bcrypt, this is the cost for hashing the password and defaults to
|
115
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 12. If
|
107
116
|
# using other algorithms, it sets how many times you want the password to be hashed.
|
117
|
+
# The number of stretches used for generating the hashed password are stored
|
118
|
+
# with the hashed password. This allows you to change the stretches without
|
119
|
+
# invalidating existing passwords.
|
108
120
|
#
|
109
121
|
# Limiting the stretches to just one in testing will increase the performance of
|
110
122
|
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
111
123
|
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
112
124
|
# algorithm), the cost increases exponentially with the number of stretches (e.g.
|
113
125
|
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
114
|
-
config.stretches = Rails.env.test? ? 1 :
|
126
|
+
config.stretches = Rails.env.test? ? 1 : 12
|
115
127
|
|
116
128
|
# Set up a pepper to generate the hashed password.
|
117
129
|
# config.pepper = '<%= SecureRandom.hex(64) %>'
|
@@ -244,14 +256,14 @@ Devise.setup do |config|
|
|
244
256
|
|
245
257
|
# ==> Navigation configuration
|
246
258
|
# Lists the formats that should be treated as navigational. Formats like
|
247
|
-
# :html
|
259
|
+
# :html should redirect to the sign in page when the user does not have
|
248
260
|
# access, but formats like :xml or :json, should return 401.
|
249
261
|
#
|
250
262
|
# If you have any extra navigational formats, like :iphone or :mobile, you
|
251
263
|
# should add them to the navigational formats lists.
|
252
264
|
#
|
253
265
|
# The "*/*" below is required to match Internet Explorer requests.
|
254
|
-
# config.navigational_formats = ['*/*', :html]
|
266
|
+
# config.navigational_formats = ['*/*', :html, :turbo_stream]
|
255
267
|
|
256
268
|
# The default HTTP method used to sign out a resource. Default is :delete.
|
257
269
|
config.sign_out_via = :delete
|
@@ -284,12 +296,14 @@ Devise.setup do |config|
|
|
284
296
|
# so you need to do it manually. For the users scope, it would be:
|
285
297
|
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
286
298
|
|
287
|
-
# ==>
|
288
|
-
#
|
289
|
-
#
|
290
|
-
#
|
291
|
-
#
|
292
|
-
#
|
299
|
+
# ==> Hotwire/Turbo configuration
|
300
|
+
# When using Devise with Hotwire/Turbo, the http status for error responses
|
301
|
+
# and some redirects must match the following. The default in Devise for existing
|
302
|
+
# apps is `200 OK` and `302 Found` respectively, but new apps are generated with
|
303
|
+
# these new defaults that match Hotwire/Turbo behavior.
|
304
|
+
# Note: These might become the new default in future versions of Devise.
|
305
|
+
config.responder.error_status = :unprocessable_entity
|
306
|
+
config.responder.redirect_status = :see_other
|
293
307
|
|
294
308
|
# ==> Configuration for :registerable
|
295
309
|
|
metadata
CHANGED
@@ -1,55 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-devise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas von Deyen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: 7.0.0
|
20
|
-
- - "<"
|
17
|
+
- - "~>"
|
21
18
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
19
|
+
version: '7.0'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
|
-
- - "
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 7.0.0
|
30
|
-
- - "<"
|
24
|
+
- - "~>"
|
31
25
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
26
|
+
version: '7.0'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: devise
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: 4.7.1
|
40
|
-
- - "<"
|
31
|
+
- - "~>"
|
41
32
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
33
|
+
version: '4.9'
|
43
34
|
type: :runtime
|
44
35
|
prerelease: false
|
45
36
|
version_requirements: !ruby/object:Gem::Requirement
|
46
37
|
requirements:
|
47
|
-
- - "
|
48
|
-
- !ruby/object:Gem::Version
|
49
|
-
version: 4.7.1
|
50
|
-
- - "<"
|
38
|
+
- - "~>"
|
51
39
|
- !ruby/object:Gem::Version
|
52
|
-
version: '
|
40
|
+
version: '4.9'
|
53
41
|
- !ruby/object:Gem::Dependency
|
54
42
|
name: capybara
|
55
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,10 +132,10 @@ files:
|
|
144
132
|
- CHANGELOG.md
|
145
133
|
- LICENSE
|
146
134
|
- README.md
|
135
|
+
- app/assets/builds/alchemy-devise.css
|
136
|
+
- app/assets/builds/alchemy-devise.css.map
|
147
137
|
- app/assets/stylesheets/alchemy-devise.scss
|
148
138
|
- app/assets/stylesheets/alchemy-devise/login.scss
|
149
|
-
- app/assets/stylesheets/alchemy-devise/users.scss
|
150
|
-
- app/assets/stylesheets/alchemy/admin/alchemy-devise.css
|
151
139
|
- app/controllers/alchemy/admin/passwords_controller.rb
|
152
140
|
- app/controllers/alchemy/admin/user_sessions_controller.rb
|
153
141
|
- app/controllers/alchemy/admin/users_controller.rb
|
@@ -158,6 +146,8 @@ files:
|
|
158
146
|
- app/views/alchemy/admin/passwords/new.html.erb
|
159
147
|
- app/views/alchemy/admin/user_sessions/new.html.erb
|
160
148
|
- app/views/alchemy/admin/users/_fields.html.erb
|
149
|
+
- app/views/alchemy/admin/users/_resource_table.html.erb
|
150
|
+
- app/views/alchemy/admin/users/_table.html.erb
|
161
151
|
- app/views/alchemy/admin/users/_user.html.erb
|
162
152
|
- app/views/alchemy/admin/users/edit.html.erb
|
163
153
|
- app/views/alchemy/admin/users/index.html.erb
|
@@ -210,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
210
200
|
- !ruby/object:Gem::Version
|
211
201
|
version: '0'
|
212
202
|
requirements: []
|
213
|
-
rubygems_version: 3.
|
203
|
+
rubygems_version: 3.5.16
|
214
204
|
signing_key:
|
215
205
|
specification_version: 4
|
216
206
|
summary: Devise based user authentication for AlchemyCMS.
|