rodauth-rails 2.2.0 → 2.2.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 +4 -4
- data/lib/rodauth/rails/app.rb +10 -3
- data/lib/rodauth/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cdc58b295a3bfe903d3b1f964a6f69ab6c407e798b237017d75a2a37556666b1
|
|
4
|
+
data.tar.gz: ce57a3dfcb02692b2c7e3b1257c74fc511097ab949913cc1447a7768e53635f3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1e02cb7e4e3a4b206d2daccc16fa5ed390b6e9af4960eba745407483fa3d4b934ca291500e6c99aae35de628686c9704f97f0e24466530d0d2edd91f669441d7
|
|
7
|
+
data.tar.gz: c1cda4cb3be9fdaccea28f1a9b203b3197623f5744b9bfb9a0b806ecde0940adfe838ae4ae49c90f3fbb35821f0605aa0114cb17ec94709c07183e542d69fb6d
|
data/lib/rodauth/rails/app.rb
CHANGED
|
@@ -8,6 +8,7 @@ module Rodauth
|
|
|
8
8
|
plugin :middleware, forward_response_headers: true, next_if_not_found: true
|
|
9
9
|
plugin :hooks
|
|
10
10
|
plugin :pass
|
|
11
|
+
plugin :flash
|
|
11
12
|
|
|
12
13
|
def self.configure(*args, render: Rodauth::Rails.tilt?, **options, &block)
|
|
13
14
|
auth_class = args.shift if args[0].is_a?(Class)
|
|
@@ -19,7 +20,7 @@ module Rodauth
|
|
|
19
20
|
# we'll render Rodauth's built-in view templates within Rails layouts
|
|
20
21
|
plugin :render, layout: false unless render == false
|
|
21
22
|
|
|
22
|
-
plugin :rodauth, auth_class: auth_class, name: name, csrf: false,
|
|
23
|
+
plugin :rodauth, auth_class: auth_class, name: name, csrf: false, json: true, render: render, **options, &block
|
|
23
24
|
|
|
24
25
|
# we need to do it after request methods from rodauth have been included
|
|
25
26
|
self::RodaRequest.include RequestMethods
|
|
@@ -31,12 +32,18 @@ module Rodauth
|
|
|
31
32
|
end
|
|
32
33
|
end
|
|
33
34
|
|
|
34
|
-
after do
|
|
35
|
+
after do |_res|
|
|
35
36
|
rails_request.commit_flash
|
|
36
37
|
end
|
|
37
38
|
|
|
39
|
+
# API-only Rails apps don't have flash support, in which case we fall
|
|
40
|
+
# back to Roda's flash.
|
|
38
41
|
def flash
|
|
39
|
-
|
|
42
|
+
if ActionDispatch::Request.method_defined?(:flash)
|
|
43
|
+
rails_request.flash
|
|
44
|
+
else
|
|
45
|
+
super
|
|
46
|
+
end
|
|
40
47
|
end
|
|
41
48
|
|
|
42
49
|
def rails_routes
|