usps-jwt_auth 1.0.1 → 1.0.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: 6834ab05dff7e13a36167170c9540830542bb4c7eb0f259d6d504931d157dad3
4
- data.tar.gz: f9e6b213d2e07d86e51f9ca2cdd05e7aeeb9a7093e65aa48f8f239eaff56c4e4
3
+ metadata.gz: 9e2e8d2e027497bac633a3d08728ba3b5da05a0d014db956cf584c1a67a6a752
4
+ data.tar.gz: 43c9b06965566235745ef4b5840ceb52d3fdc01ea842a60c918d869292954e8f
5
5
  SHA512:
6
- metadata.gz: ae5a78f313a212dc6b994a6cfa97ea7855f1841c009f9136bd7882e3e32f7d5608ce3b74790a2fc1a15928404f5f09b6ecd6cd7dbbc16184029a65cd8c0b4cdd
7
- data.tar.gz: 50b558173a359ca51c729e74294278f6d90f56daf2fb34f39d93f3d4cdeead1b7226692c5a50c137aca853ebbdfd5831186b2c591a32b023b9316ab0aec3d794
6
+ metadata.gz: 5a8aa980af7439ac3c50d54c4524be031b8adf0336039f292859adeaae5a990e8ada983e031eb935cb6cc7b618fe91df83af46a7d079f9588b66a8da3b2ef568
7
+ data.tar.gz: d5af62f82f8e8b57109d7576a0fd2a477d3523c47bf75620f833d01fdf548cd402c0ed9ed31b636aec9018ef86d2080527ec122554c1f7e5b825d54caad17f8f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps-jwt_auth (1.0.1)
4
+ usps-jwt_auth (1.0.3)
5
5
  activesupport (~> 8.0)
6
6
  colorize (~> 1.1)
7
7
  fileutils (~> 1.7)
@@ -73,10 +73,18 @@ module Usps
73
73
  store_jwt(params[:jwt])
74
74
  ensure_valid_jwt_has_valid_member!
75
75
 
76
- redirect_to(params[:path] || root_path)
76
+ redirect_to_path!
77
77
  @set_new_jwt = true
78
78
  end
79
79
 
80
+ def redirect_to_path!
81
+ if params.key?(:query_string)
82
+ redirect_to(params[:path] || root_path, query_string: query_string)
83
+ else
84
+ redirect_to(params[:path] || root_path)
85
+ end
86
+ end
87
+
80
88
  def store_jwt(token)
81
89
  session[:jwt] = token
82
90
  cookies[:jwt] = { value: token, domain: cookie_domain, httponly: true }
@@ -111,6 +119,7 @@ module Usps
111
119
  production = "#{url}?application=#{JwtAuth.config.audience}"
112
120
  url = JwtAuth.config.environment.development? ? local : production
113
121
  url = "#{url}&path=#{request.path}"
122
+ url = "#{url}&query_string=#{CGI.escape(request.query_string)}" if request.query_string.present?
114
123
 
115
124
  redirect_to(url, allow_other_host: true)
116
125
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module JwtAuth
5
- VERSION = '1.0.1'
5
+ VERSION = '1.0.3'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-jwt_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander