mumsnet_jwt 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mumsnet_jwt.rb +2 -2
- 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: 5f6ec1093764147022748cf5d437fa487872f7a0
|
4
|
+
data.tar.gz: f2398cbba22e01e763b62fe2d744588a498ccf40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4bb19d5d78d1ed63f438be9b12adf105e7eb6ddeaa64ddd1ff67c4ce79762c9ad2598b7e77e91685ddbba3e056b67cba286083e75ba5717748a739b9e6d42f3
|
7
|
+
data.tar.gz: 7d9c5af7f5e07b4285ed478b100f6e60f0851906dcc6e3cc79da300223782b6a14e9e520ecf4b8249ba7f95dab7d49f0ed849dfef074ff13050d478c91ec19b2
|
data/lib/mumsnet_jwt.rb
CHANGED
@@ -3,10 +3,10 @@ module MumsnetJWT
|
|
3
3
|
require 'jwt'
|
4
4
|
require 'json'
|
5
5
|
require 'base64'
|
6
|
-
DEFAULT_EXP = Time.now.utc.to_i + 60 * 60 * 24
|
7
6
|
def tokenify(extra_payload: {})
|
8
7
|
return false if env_defined?
|
9
|
-
|
8
|
+
exp = Time.now.utc.to_i + 60 * 60 * 24
|
9
|
+
payload = { client_id: ENV['JWT_CLIENT_ID'], exp: exp }.merge(extra_payload)
|
10
10
|
JWT.encode payload, jwt_secret, 'HS256' unless jwt_secret.nil?
|
11
11
|
end
|
12
12
|
|