jwt_api_auth 0.0.1.pre.2 → 0.0.1.pre.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed0ceb76ea7d4dddf1e1d38c5ffd79b40a1df043bf0c2e41e2fe22257d7f0121
|
4
|
+
data.tar.gz: a9d5bbee9fa0306909fc1f82df818429028c441caf12ecbf1d84298f90f463c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34360291d4cd06e99cd5bbf8024fef71e061f306b61c593503b03be7a422ca301765c01c8593eb9f2cf6f7f52bbd92822daca87f162c0fe659454fa9b5ae3396
|
7
|
+
data.tar.gz: 58c750eef7a477774a57b98e9a3ec221dbd28540aa7b0750e8a27456b97c314c108f20243e77c5f1bf2fe079921b13ea6ec1bc9cc59f1318f06146085f80fb63
|
@@ -5,7 +5,7 @@ module JwtApiAuth
|
|
5
5
|
skip_before_action :verify_authenticity_token
|
6
6
|
before_action :authenticate_user
|
7
7
|
|
8
|
-
rescue_from JWT::DecodeError do
|
8
|
+
rescue_from ::JWT::DecodeError do
|
9
9
|
head :unauthorized
|
10
10
|
end
|
11
11
|
|
@@ -17,7 +17,7 @@ module JwtApiAuth
|
|
17
17
|
|
18
18
|
def authenticate_user
|
19
19
|
token = request.headers['Authorization']&.split('Bearer ')&.last
|
20
|
-
JWT.decode token, JwtApiAuth.token_secret.call, true, { algorithm: 'HS256' }
|
20
|
+
::JWT.decode token, JwtApiAuth.token_secret.call, true, { algorithm: 'HS256' }
|
21
21
|
|
22
22
|
head :unauthorized unless token
|
23
23
|
end
|
data/lib/jwt_api_auth/version.rb
CHANGED