graphql-auth 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 79461c41709c7d56994651702a94ee154dd0bc20
4
- data.tar.gz: b6239eef62073916eda2bccbc61be0b9f6f283b7
3
+ metadata.gz: 2a7b7e118da956df77ba9154ca58ed7087d2d0f6
4
+ data.tar.gz: a3a70ad19577c8bc648cc21ca5035ad87cc280ad
5
5
  SHA512:
6
- metadata.gz: b6a68be89825e75ac22efbfa606e2fd4bc1c23b1f786d70c4d1e5161917a1807ab963d33ed654315714ad6885ff433cdcceef898bd1bdda22aa6383bb0a9b334
7
- data.tar.gz: 97c97beb3238267fdb598b5ef5ffc304b901626b0fd61a3f0f5e54a56c1198e96a6d2429b8441c94671b3f9d555757ba63a767a659a271df6e9c7890f2f6c3bb
6
+ metadata.gz: 30111d8b814841ffca793b203d5690059e1a18a5a8add1cc705810c5e5b3288708c82f04e4413fc3afef0b735ea1045f8d156ced5888c5d077feacfeb844fcac
7
+ data.tar.gz: e6bcb40a2e314b73bfc53c95f4cc937d794d3203a2bdd4cdfb4f630df346d2adf6a0795f7e6be24077274eb7b782a02715b7566303e669ca7c00522a9b32fcc5
@@ -8,8 +8,12 @@ module GraphQL
8
8
  TYPE = 'Bearer'
9
9
 
10
10
  class << self
11
- def issue(payload, set_expiration = true)
12
- payload.merge!(expiration) if set_expiration.present?
11
+ def issue(payload, custom_expiration = nil)
12
+ if custom_expiration.present? && custom_expiration.kind_of? ActiveSupport::Duration
13
+ payload[:exp] = custom_expiration
14
+ else
15
+ payload.merge!(expiration)
16
+ end
13
17
 
14
18
  token = JWT.encode payload,
15
19
  auth_secret,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Ferland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-05 00:00:00.000000000 Z
11
+ date: 2018-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler