mumsnet_jwt 2.1.4 → 2.2.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: aadd88b0e4d6ee25b320644656a96a4cd1c25f3a
|
4
|
+
data.tar.gz: 5900c62cedc469bac4729db305f0aa9a5c9e3ca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4455ba7bac462958ae2a9f734c313e58ab0410aa9f0934ab003ee72a9f94d5b32381697a0e4203d1bf5778494775e14e0308301e2817d123a6cc1f6ba14cd261
|
7
|
+
data.tar.gz: 538f877f8d8a1f29a22569eb39397f99a6c6801127019558e059bdfcf56d51b37e2b2fa2a74426df11cfa7ac2aabf0ab2363aed1886af974d86d272e42137f47
|
data/lib/mumsnet_jwt.rb
CHANGED
@@ -6,7 +6,7 @@ module MumsnetJWT
|
|
6
6
|
DEFAULT_EXP = Time.now.utc.to_i + 60 * 60 * 24
|
7
7
|
def tokenify(extra_payload: {})
|
8
8
|
return false if env_defined?
|
9
|
-
payload = { client_id: ENV['JWT_CLIENT_ID'],
|
9
|
+
payload = { client_id: ENV['JWT_CLIENT_ID'], exp: DEFAULT_EXP }.merge(extra_payload)
|
10
10
|
JWT.encode payload, jwt_secret, 'HS256' unless jwt_secret.nil?
|
11
11
|
end
|
12
12
|
|
@@ -60,7 +60,7 @@ module MumsnetJWT
|
|
60
60
|
private
|
61
61
|
|
62
62
|
def env_defined?
|
63
|
-
ENV['JWT_CLIENT_ID'].nil? || ENV['JWT_SECRETS'].nil?
|
63
|
+
ENV['JWT_CLIENT_ID'].nil? || ENV['JWT_SECRETS'].nil?
|
64
64
|
end
|
65
65
|
|
66
66
|
def client_id_from_token(token)
|