rodauth-rails 1.15.0 → 1.15.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/lib/generators/rodauth/install_generator.rb +1 -1
- data/lib/generators/rodauth/migration_generator.rb +1 -0
- data/lib/generators/rodauth/templates/INSTRUCTIONS +17 -44
- data/lib/generators/rodauth/templates/app/misc/rodauth_main.rb.tt +0 -3
- data/lib/generators/rodauth/templates/app/models/account.rb.tt +1 -1
- data/lib/rodauth/rails/feature/instrumentation.rb +11 -1
- data/lib/rodauth/rails/version.rb +1 -1
- data/rodauth-rails.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4347261e8bb70c5e8f8cd218b0485d335eae250b8efc51677acb0bb7625e655b
|
4
|
+
data.tar.gz: d00e315a95b9c8659c29eec2e1722d95c6b77d7804682c3ad0c70058df1ee709
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7218d821e3d83d779c40c1ae6a5a0aef7d1ff1e46bb207805f23daf1480f0cdbef19f7e24165d21fc8647bfe9c64973a162d83028a145df60e63c5d2b67ba915
|
7
|
+
data.tar.gz: c0a318f879f6cf35daade60784e7cc896d061d14c93281475d33831aa95e9377d3664cb3d7e86ab32ed99984ee9f477f37282c204860c8a8cf9ed5ee3cf7ad84
|
data/README.md
CHANGED
@@ -12,11 +12,13 @@ Provides Rails integration for the [Rodauth] authentication framework.
|
|
12
12
|
* [OmniAuth guide](https://github.com/janko/rodauth-rails/wiki/OmniAuth)
|
13
13
|
* [JSON Request Documentation for Rodauth](https://documenter.getpostman.com/view/26686011/2s9YC7SWn9)
|
14
14
|
|
15
|
-
🎥 Screencasts:
|
15
|
+
🎥 Screencasts / Streams:
|
16
16
|
|
17
|
-
* [Rails Authentication with Rodauth](https://www.youtube.com/watch?v=2hDpNikacf0)
|
18
|
-
* [Multifactor Authentication with Rodauth](https://
|
19
|
-
* [
|
17
|
+
* [Rails Authentication with Rodauth](https://www.youtube.com/watch?v=2hDpNikacf0) \[8:23\]
|
18
|
+
* [Multifactor Authentication via TOTP with Rodauth](https://youtu.be/9ON-kgXpz2A) \[4:36\]
|
19
|
+
* [Multifactor Authentication via Recovery Codes with Rodauth](https://youtu.be/lkFCcE1Q5-w) \[4:24\]
|
20
|
+
* [Adding Admin Accounts with Rodauth](https://www.youtube.com/watch?v=N6z7AtKSpNI) \[1:25:55\]
|
21
|
+
* [Integrating Passkeys into Rails with Rodauth](https://www.youtube.com/watch?v=kGzgmfCmnmY) \[59:47\]
|
20
22
|
|
21
23
|
📚 Articles:
|
22
24
|
|
@@ -346,7 +348,7 @@ instead.
|
|
346
348
|
|
347
349
|
If you're using a background processing library without an Active Job adapter,
|
348
350
|
or a 3rd-party service for sending transactional emails, see [this wiki
|
349
|
-
page][custom mailer
|
351
|
+
page][custom mailer job] on how to set it up.
|
350
352
|
|
351
353
|
## Migrations
|
352
354
|
|
@@ -786,7 +788,7 @@ conduct](CODE_OF_CONDUCT.md).
|
|
786
788
|
[internal_request]: http://rodauth.jeremyevans.net/rdoc/files/doc/internal_request_rdoc.html
|
787
789
|
[path_class_methods]: https://rodauth.jeremyevans.net/rdoc/files/doc/path_class_methods_rdoc.html
|
788
790
|
[account types]: https://github.com/janko/rodauth-rails/wiki/Account-Types
|
789
|
-
[custom mailer
|
791
|
+
[custom mailer job]: https://github.com/janko/rodauth-rails/wiki/Custom-Mailer-Job
|
790
792
|
[Turbo]: https://turbo.hotwired.dev/
|
791
793
|
[rodauth-model]: https://github.com/janko/rodauth-model
|
792
794
|
[JSON API]: https://github.com/janko/rodauth-rails/wiki/JSON-API
|
@@ -93,6 +93,7 @@ module Rodauth
|
|
93
93
|
reset_password: { reset_password_table: "%{singular}_password_reset_keys" },
|
94
94
|
email_auth: { email_auth_table: "%{singular}_email_auth_keys" },
|
95
95
|
otp: { otp_keys_table: "%{singular}_otp_keys" },
|
96
|
+
otp_unlock: { otp_unlock_table: "%{singular}_otp_unlocks" },
|
96
97
|
sms_codes: { sms_codes_table: "%{singular}_sms_codes" },
|
97
98
|
recovery_codes: { recovery_codes_table: "%{singular}_recovery_codes" },
|
98
99
|
webauthn: { webauthn_keys_table: "%{singular}_webauthn_keys", webauthn_user_ids_table: "%{singular}_webauthn_user_ids", webauthn_keys_account_id_column: "%{singular}_id" },
|
@@ -1,58 +1,31 @@
|
|
1
1
|
===============================================================================
|
2
2
|
|
3
|
-
|
3
|
+
* Ensure you have defined a root path in your config/routes.rb. For example:
|
4
4
|
|
5
|
-
|
6
|
-
is an example of default_url_options appropriate for a development environment
|
7
|
-
in config/environments/development.rb:
|
5
|
+
root to: "pages#home"
|
8
6
|
|
9
|
-
|
7
|
+
* Ensure you're displaying flash messages in your layout template. For example:
|
10
8
|
|
11
|
-
|
9
|
+
<% if notice %>
|
10
|
+
<div class="alert alert-success"><%= notice %></div>
|
11
|
+
<% end %>
|
12
|
+
<% if alert %>
|
13
|
+
<div class="alert alert-danger"><%= alert %></div>
|
14
|
+
<% end %>
|
12
15
|
|
13
|
-
|
16
|
+
* Titles for Rodauth pages are available via @page_title instance variable
|
17
|
+
by default, you can use it in your layout file:
|
14
18
|
|
15
|
-
|
16
|
-
For example:
|
19
|
+
<title><%= @page_title || "Default title" %></title>
|
17
20
|
|
18
|
-
|
21
|
+
* You can copy Rodauth views into your app by running:
|
19
22
|
|
20
|
-
|
23
|
+
rails g rodauth:views # default bootstrap views
|
21
24
|
|
22
|
-
|
23
|
-
For example:
|
25
|
+
rails g rodauth:views --css=tailwind # tailwind views (requires @tailwindcss/forms plugin)
|
24
26
|
|
25
|
-
|
26
|
-
<div class="alert alert-success"><%= notice %></div>
|
27
|
-
<% end %>
|
28
|
-
<% if alert %>
|
29
|
-
<div class="alert alert-danger"><%= alert %></div>
|
30
|
-
<% end %>
|
27
|
+
* You can copy email templates and generate mailer integration by running:
|
31
28
|
|
32
|
-
|
33
|
-
|
34
|
-
4. Titles for Rodauth pages are available via @page_title instance variable
|
35
|
-
by default, you can use it in your layout file:
|
36
|
-
|
37
|
-
<head>
|
38
|
-
<title><%= @page_title || "Default title" %></title>
|
39
|
-
...
|
40
|
-
</head>
|
41
|
-
|
42
|
-
* Not required *
|
43
|
-
|
44
|
-
5. You can copy Rodauth views (for customization) to your app by running:
|
45
|
-
|
46
|
-
rails g rodauth:views # default bootstrap views
|
47
|
-
|
48
|
-
rails g rodauth:views --css=tailwind # tailwind views (requires @tailwindcss/forms plugin)
|
49
|
-
|
50
|
-
* Not required *
|
51
|
-
|
52
|
-
6. You can generate email templates and mailer integration by running:
|
53
|
-
|
54
|
-
rails g rodauth:mailer
|
55
|
-
|
56
|
-
* Not required *
|
29
|
+
rails g rodauth:mailer
|
57
30
|
|
58
31
|
===============================================================================
|
@@ -193,9 +193,6 @@ class RodauthMain < Rodauth::Rails::Auth
|
|
193
193
|
|
194
194
|
# Redirect to login page after password reset.
|
195
195
|
reset_password_redirect { login_path }
|
196
|
-
|
197
|
-
# Ensure requiring login follows login route changes.
|
198
|
-
require_login_redirect { login_path }
|
199
196
|
<% end -%>
|
200
197
|
|
201
198
|
# ==> Deadlines
|
@@ -2,7 +2,7 @@
|
|
2
2
|
class <%= table_prefix.camelize %> < ApplicationRecord
|
3
3
|
include Rodauth::Rails.model
|
4
4
|
<% if ActiveRecord.version >= Gem::Version.new("7.0") -%>
|
5
|
-
enum :status, unverified: 1, verified: 2, closed: 3
|
5
|
+
enum :status, { unverified: 1, verified: 2, closed: 3 }
|
6
6
|
<% else -%>
|
7
7
|
enum status: { unverified: 1, verified: 2, closed: 3 }
|
8
8
|
<% end -%>
|
@@ -25,7 +25,7 @@ module Rodauth
|
|
25
25
|
def rails_render(*)
|
26
26
|
render_output = nil
|
27
27
|
rails_controller_instance.view_runtime = rails_controller_instance.send(:cleanup_view_runtime) do
|
28
|
-
|
28
|
+
rails_benchmark { render_output = super }
|
29
29
|
end
|
30
30
|
render_output
|
31
31
|
end
|
@@ -79,6 +79,16 @@ module Rodauth
|
|
79
79
|
response.request = rails_request
|
80
80
|
response
|
81
81
|
end
|
82
|
+
|
83
|
+
if ActionPack.version >= Gem::Version.new("8.0.0.beta1")
|
84
|
+
def rails_benchmark(&block)
|
85
|
+
ActiveSupport::Benchmark.realtime(:float_millisecond, &block)
|
86
|
+
end
|
87
|
+
else
|
88
|
+
def rails_benchmark(&block)
|
89
|
+
Benchmark.ms(&block)
|
90
|
+
end
|
91
|
+
end
|
82
92
|
end
|
83
93
|
end
|
84
94
|
end
|
data/rodauth-rails.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
|
|
16
16
|
spec.files = Dir["README.md", "LICENSE.txt", "lib/**/*", "*.gemspec"]
|
17
17
|
spec.require_paths = ["lib"]
|
18
18
|
|
19
|
-
spec.add_dependency "railties", ">= 5.0", "< 8"
|
19
|
+
spec.add_dependency "railties", ">= 5.0", "< 8.1"
|
20
20
|
spec.add_dependency "rodauth", "~> 2.36"
|
21
21
|
spec.add_dependency "roda", "~> 3.76"
|
22
22
|
spec.add_dependency "sequel-activerecord_connection", "~> 1.1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rodauth-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Janko Marohnić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08
|
11
|
+
date: 2024-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '5.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '8'
|
22
|
+
version: '8.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '5.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '8'
|
32
|
+
version: '8.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rodauth
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|