Class: Brut::FrontEnd::CsrfProtector
- Inherits:
-
Object
- Object
- Brut::FrontEnd::CsrfProtector
- Defined in:
- lib/brut/front_end/csrf_protector.rb
Overview
Base for custom logic around CSRF protection. Brut configures Rack::Protection::AuthenticityToken
for all requests, and
this happens early in the request. The idea is that no real POST should be missing a CSRF token. That said, there are times
when it must be skipped, such as for webhooks. In that case, you can extend this class and configure it via
Brut.container.override("csrf_protector", YourCustomCsrfProtector.new)
in your App
class' initializer.
Instance Method Summary collapse
-
#allowed?(env) ⇒ Boolean
Return true if the request should be allowed without a CSRF token.
Instance Method Details
#allowed?(env) ⇒ Boolean
Return true if the request should be allowed without a CSRF token. This implementation returns false.
27 28 29 |
# File 'lib/brut/front_end/csrf_protector.rb', line 27 def allowed?(env) false end |