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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/usps/jwt_auth/concern.rb +10 -1
- data/lib/usps/jwt_auth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9e2e8d2e027497bac633a3d08728ba3b5da05a0d014db956cf584c1a67a6a752
|
|
4
|
+
data.tar.gz: 43c9b06965566235745ef4b5840ceb52d3fdc01ea842a60c918d869292954e8f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5a8aa980af7439ac3c50d54c4524be031b8adf0336039f292859adeaae5a990e8ada983e031eb935cb6cc7b618fe91df83af46a7d079f9588b66a8da3b2ef568
|
|
7
|
+
data.tar.gz: d5af62f82f8e8b57109d7576a0fd2a477d3523c47bf75620f833d01fdf548cd402c0ed9ed31b636aec9018ef86d2080527ec122554c1f7e5b825d54caad17f8f
|
data/Gemfile.lock
CHANGED
|
@@ -73,10 +73,18 @@ module Usps
|
|
|
73
73
|
store_jwt(params[:jwt])
|
|
74
74
|
ensure_valid_jwt_has_valid_member!
|
|
75
75
|
|
|
76
|
-
|
|
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
|