solidus_jwt 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/solidus_jwt/concerns/encodeable.rb +3 -2
- data/lib/solidus_jwt/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20a8812041640dfdc3cc4e17aa167507f99fd01b
|
4
|
+
data.tar.gz: 8005596f40d291047b2c940abd721b9bb57776b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c120947ba2b1adf7b57d0128bcc32c35ffd13758f91c52a705221b138e4851bb9e7f58841216a1e2edfe85b68096efdea495493b63003ebc9f8b234da20eaa33
|
7
|
+
data.tar.gz: ea576aff33c96f219989f760fdbaed27393a76270ed99090a091138fdf5856b0622e7bcb0f0e428688ff4756286011951166abe24bc9ff4a6233ab2b76c0da73
|
data/README.md
CHANGED
@@ -11,9 +11,10 @@ module SolidusJwt
|
|
11
11
|
#
|
12
12
|
def encode(payload:, expires_in: nil)
|
13
13
|
# @see https://github.com/jwt/ruby-jwt#support-for-reserved-claim-names
|
14
|
+
current_time = Time.current.to_i
|
14
15
|
extras = {}
|
15
|
-
extras['exp'] =
|
16
|
-
extras['iat'] =
|
16
|
+
extras['exp'] = current_time + expires_in if expires_in.present?
|
17
|
+
extras['iat'] = current_time
|
17
18
|
|
18
19
|
payload = extras.merge(payload).as_json
|
19
20
|
JWT.encode(payload, SolidusJwt::Config.jwt_secret,
|
data/lib/solidus_jwt/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_jwt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Taylor Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: solidus_core
|
@@ -236,16 +236,16 @@ dependencies:
|
|
236
236
|
name: sqlite3
|
237
237
|
requirement: !ruby/object:Gem::Requirement
|
238
238
|
requirements:
|
239
|
-
- - "
|
239
|
+
- - "~>"
|
240
240
|
- !ruby/object:Gem::Version
|
241
|
-
version:
|
241
|
+
version: 1.3.6
|
242
242
|
type: :development
|
243
243
|
prerelease: false
|
244
244
|
version_requirements: !ruby/object:Gem::Requirement
|
245
245
|
requirements:
|
246
|
-
- - "
|
246
|
+
- - "~>"
|
247
247
|
- !ruby/object:Gem::Version
|
248
|
-
version:
|
248
|
+
version: 1.3.6
|
249
249
|
description: Add Json Web Tokens to Solidus API
|
250
250
|
email: t.skukx@gmail.com
|
251
251
|
executables: []
|