Class: RubyAPI::Plugins::Auth
- Inherits:
-
RubyAPI::Plugin
- Object
- RubyAPI::Plugin
- RubyAPI::Plugins::Auth
- Defined in:
- lib/fastrb/plugins/auth.rb
Class Method Summary collapse
Methods inherited from RubyAPI::Plugin
inherited, option, options, plugin_name, register_cli, register_routes
Class Method Details
.on_load(app) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fastrb/plugins/auth.rb', line 7 def self.on_load(app) app.before do |ctx| payload = ctx.get(:jwt_payload) unless payload status = [:unauthorized_status] body = [:unauthorized_body] ctx.response_status = status ctx.response_body = body end end end |