authtown 0.3.0 → 0.4.0

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: 1d2619b2daf3aa55e9406234f5ebffcc6120db6b88c11b86f220349e3b1f55fc
4
- data.tar.gz: 27d16fd12a96f4e4cda4d0c642b780768df4380132c1b93ad1c2de354ff5e58b
3
+ metadata.gz: 5354c22eca5eed6bbf2bdfb9abc22b34681b4eea99ae84a22e692a522b12df64
4
+ data.tar.gz: ccf72db36f90a5059724f1df6aaa4c16ac261bf8f7fa27c093b08ffe010c35f5
5
5
  SHA512:
6
- metadata.gz: 0afe6909ccf879aba4e28484f3f83b035613e80e43940e1a4aba3c0b3dd67f9aae7cc3f55122ce4276eaf21426829e9c515b57b6293a431beb8acd1ab416641d
7
- data.tar.gz: 37e8e4f7b0c438050eee6321cea152c0f776667262dee23859698c902184b6d8f69fdfd628d2e28e410e1aa40df050bd3ed43e1d0f03dba82fd5e108c3a250b8
6
+ metadata.gz: ffa84f2f6d723e4c790ee27a242231fcfcb3c70f4567f163d431a7b76d750911e3b98a4d63a4d40cdcd663da20ac4f7d932d59f0107732077d93cd68307d48af
7
+ data.tar.gz: 6444e3cf4af35c02c8c88bf6bd93d17aa2226e81ea193f7353eaae3b8a757d1a201209945a08939604ae5f6586d9f8075edbbf876da5026f31ead98e2bb7b79c
data/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2024-05-06
11
+
12
+ - Another refactor to support latest updates in Bridgetown v2
13
+
10
14
  ## [0.3.0] - 2024-04-07
11
15
 
12
16
  - Refactor how Bridgetown's view layer is integrated with Rodauth, improve performance
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Authtown
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
@@ -41,23 +41,11 @@ module Authtown::ViewMixin
41
41
  "#{kwargs.dig(:locals, :rodauth).prefix.delete_prefix("/")}/#{kwargs[:template]}"
42
42
  end
43
43
 
44
- # TODO: this should really be some sort of exposed method from the routes plugin
45
- response["X-Bridgetown-SSR"] = "1"
44
+ routes_manifest.routes.each do |route|
45
+ file, localized_slugs = route
46
+ next unless localized_slugs.first == kwargs[:template]
46
47
 
47
- Bridgetown::Routes::Manifest.generate_manifest(bridgetown_site).each do |route|
48
- file, localized_file_slugs = route
49
-
50
- file_slug = localized_file_slugs.first
51
-
52
- next unless file_slug == kwargs[:template]
53
-
54
- Bridgetown::Routes::CodeBlocks.eval_route_file file, file_slug, self
55
- route_block = Bridgetown::Routes::CodeBlocks.route_block(file_slug)
56
- response.instance_variable_set(
57
- :@_route_file_code, route_block.instance_variable_get(:@_route_file_code)
58
- ) # could be nil
59
- @_route_locals = kwargs[:locals]
60
- return instance_exec(request, &route_block)
48
+ return run_file_route(file, slug: localized_slugs.first)
61
49
  end
62
50
 
63
51
  Bridgetown.logger.warn("Rodauth template not found: #{kwargs[:template]}")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authtown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-07 00:00:00.000000000 Z
11
+ date: 2024-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown