rodauth-rails 1.15.0 → 1.15.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12ac51c0ef57f053d8bdc843eef7a846554defb7e37403b9ccf2ab83bd52fb6b
4
- data.tar.gz: 5854a05239bfbb92f2b0aecc5c0e9dd1de22388d364afc6f4fe601e4900c54c5
3
+ metadata.gz: 4347261e8bb70c5e8f8cd218b0485d335eae250b8efc51677acb0bb7625e655b
4
+ data.tar.gz: d00e315a95b9c8659c29eec2e1722d95c6b77d7804682c3ad0c70058df1ee709
5
5
  SHA512:
6
- metadata.gz: bbf3d3cc5f453756a8a52a73409de3134569aa12908be81a505e637b0a05f890735a9589df237fb1e7f2f9687a5df2ac6821586d0e4cd52995d9efd3b0989e46
7
- data.tar.gz: 6c1725dc4b64c498a6d840aba77c61c273df112bb712610b8342ebded946c7dfdb7a4e7fe33ffac69303ff8020223902040a66ebb58d6cd7247a085ceebdd448
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://www.youtube.com/watch?v=9ON-kgXpz2A&list=PLkGQXZLACDTGKsaRWstkHQdm2CUmT3SZ-) ([TOTP](https://youtu.be/9ON-kgXpz2A), [Recovery Codes](https://youtu.be/lkFCcE1Q5-w))
19
- * [Add Admin Accounts](https://www.youtube.com/watch?v=N6z7AtKSpNI)
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 worker] on how to set it up.
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 worker]: https://github.com/janko/rodauth-rails/wiki/Custom-Mailer-Worker
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
@@ -55,7 +55,7 @@ module Rodauth
55
55
  end
56
56
 
57
57
  def show_instructions
58
- readme "INSTRUCTIONS" if behavior == :invoke
58
+ readme "INSTRUCTIONS" if behavior == :invoke && !api_only?
59
59
  end
60
60
 
61
61
  private
@@ -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
- Depending on your application's configuration some manual setup may be required:
3
+ * Ensure you have defined a root path in your config/routes.rb. For example:
4
4
 
5
- 1. Ensure you have defined default url options in your environments files. Here
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
- config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
7
+ * Ensure you're displaying flash messages in your layout template. For example:
10
8
 
11
- In production, :host should be set to the actual host of your application.
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
- * Required for all applications. *
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
- 2. Ensure you have defined root_url to *something* in your config/routes.rb.
16
- For example:
19
+ <title><%= @page_title || "Default title" %></title>
17
20
 
18
- root to: "home#index"
21
+ * You can copy Rodauth views into your app by running:
19
22
 
20
- * Not required for API-only Applications *
23
+ rails g rodauth:views # default bootstrap views
21
24
 
22
- 3. Ensure you have flash messages in app/views/layouts/application.html.erb.
23
- For example:
25
+ rails g rodauth:views --css=tailwind # tailwind views (requires @tailwindcss/forms plugin)
24
26
 
25
- <% if notice %>
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
- * Not required for API-only Applications *
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
- Benchmark.ms { render_output = super }
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
@@ -1,5 +1,5 @@
1
1
  module Rodauth
2
2
  module Rails
3
- VERSION = "1.15.0"
3
+ VERSION = "1.15.2"
4
4
  end
5
5
  end
@@ -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.0
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-03 00:00:00.000000000 Z
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