usps-jwt_auth 0.3.1.pre.1 → 0.3.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/usps/jwt_auth/concern.rb +6 -0
- 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: 997cd79009d1fd99f6e9ca4432cc4caa0b5e04fc2d25e0e53bf13599b4550445
|
|
4
|
+
data.tar.gz: beb3b2c034cbb9425228c9f1d81fed525b95ed243a368b274f4db26ed79627fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0a317065f5c8f978cf8cd5be2431021470ce50c69b5cf9609030be1b6f90d7c26cc9c41e0bea69e4ea9f73e7733df18a38e113e2be4e721e321e585432e52acd
|
|
7
|
+
data.tar.gz: 5718c4d025cd45700fca00c39864189867ec71d28ce26ae91f88757d70c6ed0c47af7db10f9a753cd13f6b587c1c50bb54d95d53869271939c642fce960f798e
|
data/Gemfile.lock
CHANGED
|
@@ -73,7 +73,9 @@ module Usps
|
|
|
73
73
|
store_jwt(params[:jwt])
|
|
74
74
|
ensure_valid_jwt_has_valid_member!
|
|
75
75
|
|
|
76
|
+
Rails.logger.info 'set_new_jwt redirect' # DEBUG
|
|
76
77
|
redirect_to(params[:path] || root_path)
|
|
78
|
+
@set_new_jwt = true
|
|
77
79
|
end
|
|
78
80
|
|
|
79
81
|
def store_jwt(token)
|
|
@@ -103,6 +105,8 @@ module Usps
|
|
|
103
105
|
end
|
|
104
106
|
|
|
105
107
|
def redirect_to_login
|
|
108
|
+
return if @set_new_jwt
|
|
109
|
+
|
|
106
110
|
url = 'https://www.usps.org/jwt'
|
|
107
111
|
local = "#{url}?local&port=#{ENV.fetch('PORT', '3000')}"
|
|
108
112
|
production = "#{url}?application=#{JwtAuth.config.audience}"
|
|
@@ -116,6 +120,8 @@ module Usps
|
|
|
116
120
|
fetch_jwt
|
|
117
121
|
jwt_user
|
|
118
122
|
rescue ActiveRecord::RecordNotFound
|
|
123
|
+
Rails.logger.info 'ensure_valid_jwt_has_valid_member!' # DEBUG
|
|
124
|
+
|
|
119
125
|
reset_session
|
|
120
126
|
clear_jwt
|
|
121
127
|
@current_user = nil
|