README.md in rack-bearer_auth-0.1.1 vs README.md in rack-bearer_auth-1.0.0
- old
+ new
@@ -22,25 +22,27 @@
$ gem install rack-bearer_auth
## Configuration
-### Rsils configuration
+### Rails configuration
``` ruby
module YourApp
class Application < Rails::Application
# ...
- config.middleware.use, Rack::BearerAuth::Middleware do
+ config.middleware.use Rack::BearerAuth::Middleware do
match path: "/foo" do |token|
# validate token
+ # AccessToken.where(token: token).exists?
end
match via: :all do |token|
# validate token
+ # AccessToken.where(token: token).exists?
end
match path: "/bar", via: %i[post patch delete], token: "some_token"
end
end
@@ -51,13 +53,15 @@
``` ruby
use Rack::BearerAuth::Middleware do
match path: "/foo" do |token|
# validate token
+ # AccessToken.where(token: token).exists?
end
match via: :all do |token|
# validate token
+ # AccessToken.where(token: token).exists?
end
match path: "/bar", via: %i[post patch delete], token: "some_token"
end