jwt-auth 1.2.0 → 2.0.0
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 +4 -4
- data/README.md +9 -1
- data/lib/jwt/auth.rb +1 -0
- data/lib/jwt/auth/authentication.rb +1 -1
- data/lib/jwt/auth/errors.rb +9 -0
- data/lib/jwt/auth/token.rb +1 -1
- data/lib/jwt/auth/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 071e994384ea5a8b92ebcf11e387e0b3620c032d
|
4
|
+
data.tar.gz: ff916fe29fb2df997ba8f526ef7dc2992d76f310
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96bfb99af4c98261d9d8069d6522d729a823100515deac9d2f3d0a37b3062cf9c185e95b0e307362344a319dc0159acf6b5958012378cd0e27fc46c7bac6757d
|
7
|
+
data.tar.gz: 536591c41ada1b6d7f793d3dc3a070567e418ce6b9d0b1f8d5a48a32d2209b9833c431342db08d7766dad944b280f88e6da17b8a4c93e03b343747dfc7a2306b
|
data/README.md
CHANGED
@@ -53,11 +53,19 @@ end
|
|
53
53
|
|
54
54
|
```
|
55
55
|
|
56
|
-
Include controller methods in your `ApplicationController
|
56
|
+
Include controller methods in your `ApplicationController` and handle unauthorized errors:
|
57
57
|
|
58
58
|
```ruby
|
59
59
|
class ApplicationController < ActionController::API
|
60
60
|
include JWT::Auth::Authentication
|
61
|
+
|
62
|
+
rescue_from JWT::Auth::UnauthorizedError, :with => :handle_unauthorized
|
63
|
+
|
64
|
+
protected
|
65
|
+
|
66
|
+
def handle_unauthorized
|
67
|
+
head :unauthorized
|
68
|
+
end
|
61
69
|
end
|
62
70
|
```
|
63
71
|
|
data/lib/jwt/auth.rb
CHANGED
data/lib/jwt/auth/token.rb
CHANGED
data/lib/jwt/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jwt-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Dejonckheere
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/jwt/auth/authenticatable.rb
|
115
115
|
- lib/jwt/auth/authentication.rb
|
116
116
|
- lib/jwt/auth/configuration.rb
|
117
|
+
- lib/jwt/auth/errors.rb
|
117
118
|
- lib/jwt/auth/token.rb
|
118
119
|
- lib/jwt/auth/version.rb
|
119
120
|
- spec/configuration_spec.rb
|