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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 110cd150534a783ea2919ff38d755e8c224535a99e4c9996a90e5312813f3d5c
4
- data.tar.gz: 1c22dce90c915acad83d68f4a9608177a7d7d50b438c8ada95e059b33f45d70d
3
+ metadata.gz: cdc58b295a3bfe903d3b1f964a6f69ab6c407e798b237017d75a2a37556666b1
4
+ data.tar.gz: ce57a3dfcb02692b2c7e3b1257c74fc511097ab949913cc1447a7768e53635f3
5
5
  SHA512:
6
- metadata.gz: e67abaeaf97360f4faa457d637b1269944dedb90a450c77bffa28e315c5de8aeb8624334ee84478fa68f6d3620e6f48d671f29c73e8ddc6447243839b0517b6d
7
- data.tar.gz: 7f6668732ac4325ba61d68aa3dbb7d295162913867f333eb41329c4cfb14c4850906b7bd3109881e34469eba2737c66112705f397217e8a3f9b3a56d99eaf89b
6
+ metadata.gz: 1e02cb7e4e3a4b206d2daccc16fa5ed390b6e9af4960eba745407483fa3d4b934ca291500e6c99aae35de628686c9704f97f0e24466530d0d2edd91f669441d7
7
+ data.tar.gz: c1cda4cb3be9fdaccea28f1a9b203b3197623f5744b9bfb9a0b806ecde0940adfe838ae4ae49c90f3fbb35821f0605aa0114cb17ec94709c07183e542d69fb6d
@@ -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, flash: false, json: true, render: render, **options, &block
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
- rails_request.flash
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
@@ -1,5 +1,5 @@
1
1
  module Rodauth
2
2
  module Rails
3
- VERSION = "2.2.0"
3
+ VERSION = "2.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić