rodauth-rails 1.15.0 → 1.15.1
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
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6f6be6f7643a5ee8a8c249c4c4a5591df43a63d32c85a2b3ee1427394b7becf
|
4
|
+
data.tar.gz: a838f4ddb1eab3b8e39acdeacac4830d5eb4024b4a44a3606c5de4c754c488de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da215ea65e513b90b41203d1652955b378e1c8b1145c476d4d0a15ef9b0a1f9ebc86f6818a4e35a2405805c663047c85a309e62de41af5c4e0259645f7326596
|
7
|
+
data.tar.gz: 11770055b40a703d6e7640c6c80f192a5eccaa0605d6b7c46fe24d9d61d8438224c763571d69a86ba767a222460db90b795407756ad112def5af27aff8f79052
|
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
|
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.1
|
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-
|
11
|
+
date: 2024-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|