authify-middleware 0.0.4 → 0.0.5

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: 3ab2b6f069b5580e546fb4f3b64fac22f22b41e7
4
- data.tar.gz: 551c01d00a5db2715bc9e773597e713d0ae77fde
3
+ metadata.gz: 6a6087084d54f1a6b22b88259a4b2496321af53b
4
+ data.tar.gz: 161221957ce0c9d0c7cadf28a202fbe13be99958
5
5
  SHA512:
6
- metadata.gz: ba774bdbea724d7cc21bb93a10167342feafe72fccd61ce109489649cc65862cf0d7568213b2387e47f358fbb87407c49120464431d12791cb8135f11abce3fa
7
- data.tar.gz: fb51a6ffa9d6014b07e9a7c35731208540a63ea6e83432a4ec1afe994ed1f105820b1219cadb8940c4c9086f3cf701b0046352cccc5ab0664cdf74fefb9f53ef
6
+ metadata.gz: 0905fb915b0892b01b85dac90800db0cadcec944f9beced15762adff92f6f7e48daca415e81ad9d83869e0462ac50482a69561534af2c6c12dfc8d2e96c67995
7
+ data.tar.gz: 7fa0f33a36b3bc080917f58a6bdf6b05d32b0f9c03bd831d4b4438d06e3ecf28450303db0236570989ded1ed89d2c492072c0e90b21b51d6a7748cc0edd95d9e
@@ -11,28 +11,29 @@ module Authify
11
11
  # rubocop:disable Metrics/MethodLength
12
12
  # rubocop:disable Metrics/AbcSize
13
13
  def call(env)
14
- payload = process_token(env)
14
+ begin
15
+ payload = process_token(env)
15
16
 
16
- env[:scopes] = payload['scopes']
17
- env[:user] = payload['user']
18
- env[:authenticated] = Time.now
19
- rescue JWT::DecodeError => e
20
- env[:authenticated] = false
21
- env[:authentication_errors] ||= []
22
- env[:authentication_errors] << e
23
- rescue JWT::ExpiredSignature => e
24
- env[:authenticated] = false
25
- env[:authentication_errors] ||= []
26
- env[:authentication_errors] << e
27
- rescue JWT::InvalidIssuerError => e
28
- env[:authenticated] = false
29
- env[:authentication_errors] ||= []
30
- env[:authentication_errors] << e
31
- rescue JWT::InvalidIatError => e
32
- env[:authenticated] = false
33
- env[:authentication_errors] ||= []
34
- env[:authentication_errors] << e
35
- ensure
17
+ env[:scopes] = payload['scopes']
18
+ env[:user] = payload['user']
19
+ env[:authenticated] = Time.now
20
+ rescue JWT::DecodeError => e
21
+ env[:authenticated] = false
22
+ env[:authentication_errors] ||= []
23
+ env[:authentication_errors] << e
24
+ rescue JWT::ExpiredSignature => e
25
+ env[:authenticated] = false
26
+ env[:authentication_errors] ||= []
27
+ env[:authentication_errors] << e
28
+ rescue JWT::InvalidIssuerError => e
29
+ env[:authenticated] = false
30
+ env[:authentication_errors] ||= []
31
+ env[:authentication_errors] << e
32
+ rescue JWT::InvalidIatError => e
33
+ env[:authenticated] = false
34
+ env[:authentication_errors] ||= []
35
+ env[:authentication_errors] << e
36
+ end
36
37
  @app.call env
37
38
  end
38
39
 
@@ -3,7 +3,7 @@ module Authify
3
3
  VERSION = [
4
4
  0, # Major
5
5
  0, # Minor
6
- 4 # Patch
6
+ 5 # Patch
7
7
  ].join('.')
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: authify-middleware
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Gnagy