katalyst-koi 5.13.2 → 5.13.3

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: 947e13cad0cb9fbebc0a2ae9a077fed59df87f7c3aa4970907f9074dc27a51de
4
- data.tar.gz: b8e9cb06d231c0f3370492deaac433bb8c97c40af51ef2abb5aa9cc10e869cdb
3
+ metadata.gz: f7398eed1765ce0345e3df97c21066386ebfbb50549e677d67911059d87e1b5d
4
+ data.tar.gz: 33d95ed951170087c08848cc7fd7f27b84c3f14d6c16c0691b21e34e4ba173a5
5
5
  SHA512:
6
- metadata.gz: ad8615bec284f8cff048ea1aba209d80a7c9a1621664244020affc1f876d9c4e6b17dac220a990b7dd3bab4a64fe93b5d8774baaaa992867db8d2384340a4ab7
7
- data.tar.gz: 2cd37c3b92bb4b2ed838d5eec3495bac50e6deb06a7c825620f3408c1ad0132e9482191a3fda01fa3c2508aa8fa2508511caf7e8595d79c841c29114eacaf0eb
6
+ metadata.gz: 8ebcbc3880b4711894a225d4187f8895416020b93697b47216acfdefd7582ca9c70dae6af15505f661f6ef6a9e9c696809161ba36409a27fa82fcfda386a6c80
7
+ data.tar.gz: 763c4c3a5e0fcad8142c8c950a85a111d65466022c6e35155cc7078547df1487ab501d52f894751f5c9327a56d6e3f47ae3c433eada70de3fcf770ef5877d975
@@ -8,7 +8,7 @@ module Koi
8
8
  end
9
9
 
10
10
  def call(env)
11
- if env["PATH_INFO"].starts_with?("/admin")
11
+ if admin_path?(env["PATH_INFO"])
12
12
  admin_call(env)
13
13
  else
14
14
  @app.call(env)
@@ -43,8 +43,17 @@ module Koi
43
43
 
44
44
  private
45
45
 
46
+ # Compare paths the way the router will see them, e.g. "//admin" routes to "/admin"
47
+ def normalize_path(path)
48
+ ActionDispatch::Journey::Router::Utils.normalize_path(path)
49
+ end
50
+
51
+ def admin_path?(path)
52
+ normalize_path(path).starts_with?("/admin")
53
+ end
54
+
46
55
  def requires_authentication?(request)
47
- !request.path.starts_with?("/admin/session") && !device_flow_request?(request:)
56
+ !normalize_path(request.path).starts_with?("/admin/session") && !device_flow_request?(request:)
48
57
  end
49
58
 
50
59
  def authenticated?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: katalyst-koi
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.13.2
4
+ version: 5.13.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katalyst Interactive