activeadmin-oidc 2.0.0 → 2.0.1

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: 013ffd8d314b6537d497b578633169a575ef8a09930c6363c07a29c6c4f9e05a
4
- data.tar.gz: 39650f667cb6a69c427510b2f51eb48e11164040d8904b51bc7af4b072e09dc3
3
+ metadata.gz: 1a4d32669000d3de07114d54dc1c5d408899c1c8cf40e86b154e328ab08ed385
4
+ data.tar.gz: d1f002c56666e32b794bc1024a37b8bb06e275642c625b198664febd7caf6805
5
5
  SHA512:
6
- metadata.gz: 326a81f750548c6078850705cebc07d94577154f88201c4bf7b190207b53600bacbf742b14353d799ff0efcf4dec32b6d49a36d0779ff6f10b78ff0667971a6e
7
- data.tar.gz: edc04731d82c7a98be8469a32ff2b119589723fc5df05cc4b6cf5c92e73aa5732dbcbe54765a5d890619f4c8ad98772f955522b8e7b4bcdebc21b2d803507603
6
+ metadata.gz: 79d676e27f836c5d271925d067cb5a072450e237394b07a590ac988b779ff5200a39c79208170ec3ef930837b8ad46dbf0f97e8403b9899fb73c1a6983092ab9
7
+ data.tar.gz: 13ac29d12fda8a44ba24aa992ac61d65f63c607894e576d66276cf18f2fa478f26b881b335bf93f767296c65c2c35a9d43b1bf76ddcb48d19078dd75ce94bb8f
@@ -74,14 +74,18 @@ module ActiveAdmin
74
74
  stored_location_for(resource) || '/admin'
75
75
  end
76
76
 
77
- # Devise's default `after_omniauth_failure_path_for` calls
78
- # `new_session_path(scope)`, a URL helper Devise only generates
79
- # when :database_authenticatable mounts session routes. The
80
- # engine mounts `new_<scope>_session_path` itself (see
81
- # `mount_oidc_sessions_routes` initializer) regardless of which
82
- # modules are loaded, so we always route through that helper.
77
+ # Devise's `new_session_path(scope)` is only generated when
78
+ # `:database_authenticatable` is in the mapping's `used_helpers`,
79
+ # so an OIDC-only model never gets it. The engine mounts
80
+ # `new_<scope>_session_path` itself, but the helper lives on
81
+ # whichever route set the mapping's `router_name` points at
82
+ # main_app by default, or `<engine_name>` for hosts that mount
83
+ # Devise inside a Rails engine. Replicate Devise's own dispatch
84
+ # so the right context is asked.
83
85
  def after_omniauth_failure_path_for(scope)
84
- public_send(:"new_#{scope}_session_path")
86
+ router_name = ::Devise.mappings[scope].router_name
87
+ context = router_name ? send(router_name) : self
88
+ context.public_send(:"new_#{scope}_session_path")
85
89
  end
86
90
  end
87
91
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveAdmin
4
4
  module Oidc
5
- VERSION = "2.0.0"
5
+ VERSION = "2.0.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-oidc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Fedoronchuk