jwt_auth_token 1.2.9 → 1.3.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 +4 -4
- data/lib/jwt_auth_token.rb +11 -1
- data/lib/router_helper.rb +10 -10
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee372a6ab38f52e3521203ae5974de7e853897f9
|
4
|
+
data.tar.gz: e7e6ff8ec4b8740803f73967717b95854a2d9641
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35c191ea6a735fb83d66a49cacca8aa3c68c8b70584564863a3756e4e9146c2583cc14226ab6a5c75ae7640c028dced72b03d63e017eea88aca9941c35715904
|
7
|
+
data.tar.gz: 5be8685228d6fd55ed08ce185568b345bebf8178285b5b0724df09687d280e477b98fa64854a8670af14a27b530a0e3c707b6cd6e9f401b9f45c06d73f5640af
|
data/lib/jwt_auth_token.rb
CHANGED
@@ -19,8 +19,18 @@ module JwtAuthToken
|
|
19
19
|
@_jwt_header_name ||= "embibe-token"
|
20
20
|
end
|
21
21
|
|
22
|
+
def jwt_cookie_name
|
23
|
+
return @_jwt_cookie_name if @_jwt_cookie_name
|
24
|
+
@_jwt_cookie_name = jwt_header_name
|
25
|
+
if !Rails.env.production?
|
26
|
+
@_jwt_cookie_name = "#{Rails.env}-#{jwt_header_name}"
|
27
|
+
end
|
28
|
+
@_jwt_cookie_name
|
29
|
+
# @_jwt_cookie_name ||= "#{Rails.env}-#{jwt_header_name}"
|
30
|
+
end
|
31
|
+
|
22
32
|
def jwt_header_token
|
23
|
-
@_jwt_header_token ||= request.cookies[
|
33
|
+
@_jwt_header_token ||= request.cookies[jwt_cookie_name] || request.headers[jwt_header_name] rescue nil
|
24
34
|
end
|
25
35
|
|
26
36
|
def is_jwt_valid_token?
|
data/lib/router_helper.rb
CHANGED
@@ -38,8 +38,8 @@ module RouterHelper
|
|
38
38
|
horizontal: {url: "http://horizontal-microservice", port: 80},
|
39
39
|
content: {url: "http://content-microservice", port: 80},
|
40
40
|
mocktest: {url: "http://mocktest-microservice", port: 80},
|
41
|
-
practice: {url: "http://practice-microservice", port:
|
42
|
-
payment: {url: "http://payment-microservice", port:
|
41
|
+
practice: {url: "http://practice-microservice", port: 80},
|
42
|
+
payment: {url: "http://payment-microservice", port: 80}
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
@@ -49,8 +49,8 @@ module RouterHelper
|
|
49
49
|
horizontal: {url: "http://horizontal-microservice", port: 80},
|
50
50
|
content: {url: "http://content-microservice", port: 80},
|
51
51
|
mocktest: {url: "http://mocktest-microservice", port: 80},
|
52
|
-
practice: {url: "http://practice-microservice", port:
|
53
|
-
payment: {url: "http://payment-microservice", port:
|
52
|
+
practice: {url: "http://practice-microservice", port: 80},
|
53
|
+
payment: {url: "http://payment-microservice", port: 80}
|
54
54
|
}
|
55
55
|
end
|
56
56
|
|
@@ -60,12 +60,12 @@ module RouterHelper
|
|
60
60
|
|
61
61
|
def services_production_urls
|
62
62
|
@_services_production_urls ||= {
|
63
|
-
user: {url: "http://user-microservice", port:
|
64
|
-
horizontal: {url: "http://horizontal-microservice", port:
|
65
|
-
content: {url: "http://content-microservice", port:
|
66
|
-
mocktest: {url: "http://mocktest-microservice", port:
|
67
|
-
practice: {url: "http://practice-microservice", port:
|
68
|
-
payment: {url: "http://payment-microservice", port:
|
63
|
+
user: {url: "http://user-microservice", port: 80},
|
64
|
+
horizontal: {url: "http://horizontal-microservice", port: 80},
|
65
|
+
content: {url: "http://content-microservice", port: 80},
|
66
|
+
mocktest: {url: "http://mocktest-microservice", port: 80},
|
67
|
+
practice: {url: "http://practice-microservice", port: 80},
|
68
|
+
payment: {url: "http://payment-microservice", port: 80}
|
69
69
|
}
|
70
70
|
|
71
71
|
end
|