rodauth-rails 1.14.0 → 1.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -2
- data/README.md +1 -1
- data/lib/generators/rodauth/templates/app/controllers/rodauth_controller.rb.tt +18 -2
- data/lib/rodauth/rails/version.rb +1 -1
- data/lib/rodauth/rails.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c1c699a9d7a18673c641d2fe236bfdb2b9537ade7c6212e9f2f386738308d67
|
4
|
+
data.tar.gz: b30b4195d46e461f0235caaa1e2e453fb70260bda7d9174cbf60be8f43796f94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d67d9e2a738d66d9ba37bcf1f71f69c546d6a361e91248255966bdd8b49fadfff717ab28e44bd2cd0ad0cad784740ef631a7863b1403e56c267b8434c2d8e3
|
7
|
+
data.tar.gz: 0b501ebf1306bbf9780ec86fd9267e75b3bcae3ee69f0b7f56f0c19132f1d8a96a8d7cfcae31dbb07b5636b42064833d5d8543ceb55d3d4432d22cb28ae9aa72
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 1.14.1 (2024-05-15)
|
2
|
+
|
3
|
+
* Fix matching on account status when passing Active Record object to `Rodauth::Rails.account` (@dush)
|
4
|
+
|
1
5
|
## 1.14.0 (2024-04-09)
|
2
6
|
|
3
7
|
* Allow declaring controller callbacks for specific Rodauth routes via `:only` and `:except` keyword arguments (@janko)
|
@@ -10,8 +14,6 @@
|
|
10
14
|
|
11
15
|
* Fix format being inferred from `Accept` header instead URL path when calling `http_basic_auth` in the Rodauth middleware (@janko)
|
12
16
|
|
13
|
-
* Allow referencing custom column attributes on `rails_account` before the account is persisted (@janko)
|
14
|
-
|
15
17
|
* Retrieve auth class through the Rodauth app in generated account fixtures (@janko)
|
16
18
|
|
17
19
|
* Use `include Rodauth::Rails.model` again in generated account model (@janko)
|
data/README.md
CHANGED
@@ -254,7 +254,7 @@ end
|
|
254
254
|
```rb
|
255
255
|
class RodauthController < ApplicationController
|
256
256
|
before_action :verify_captcha, only: :login, if: -> { request.post? } # executes before Rodauth endpoints
|
257
|
-
rescue_from("
|
257
|
+
rescue_from("SomeError") { |exception| ... } # rescues around Rodauth endpoints
|
258
258
|
end
|
259
259
|
```
|
260
260
|
|
@@ -1,4 +1,20 @@
|
|
1
1
|
class RodauthController < ApplicationController
|
2
|
-
#
|
3
|
-
# registered action callbacks and
|
2
|
+
# Used by Rodauth for rendering views, CSRF protection, running any
|
3
|
+
# registered action callbacks and rescue handlers, instrumentation etc.
|
4
|
+
|
5
|
+
# Controller callbacks and rescue handlers will run around Rodauth endpoints.
|
6
|
+
# before_action :verify_captcha, only: :login, if: -> { request.post? }
|
7
|
+
# rescue_from("SomeError") { |exception| ... }
|
8
|
+
|
9
|
+
# Layout can be changed for all Rodauth pages or only certain pages.
|
10
|
+
# layout "authentication"
|
11
|
+
# layout -> do
|
12
|
+
# case rodauth.current_route
|
13
|
+
# when :login, :create_account, :verify_account, :verify_account_resend,
|
14
|
+
# :reset_password, :reset_password_request
|
15
|
+
# "authentication"
|
16
|
+
# else
|
17
|
+
# "application"
|
18
|
+
# end
|
19
|
+
# end
|
4
20
|
end
|
data/lib/rodauth/rails.rb
CHANGED
@@ -39,7 +39,7 @@ module Rodauth
|
|
39
39
|
|
40
40
|
instance = auth_class.internal_request_eval(options) do
|
41
41
|
if defined?(ActiveRecord::Base) && account.is_a?(ActiveRecord::Base)
|
42
|
-
@account = account.
|
42
|
+
@account = account.attributes_before_type_cast.symbolize_keys
|
43
43
|
elsif defined?(Sequel::Model) && account.is_a?(Sequel::Model)
|
44
44
|
@account = account.values
|
45
45
|
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.14.
|
4
|
+
version: 1.14.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-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -352,7 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
352
352
|
- !ruby/object:Gem::Version
|
353
353
|
version: '0'
|
354
354
|
requirements: []
|
355
|
-
rubygems_version: 3.5.
|
355
|
+
rubygems_version: 3.5.9
|
356
356
|
signing_key:
|
357
357
|
specification_version: 4
|
358
358
|
summary: Provides Rails integration for Rodauth.
|