Sha256: f381409581d8fe59e1c793f86033fcb247e83be52c73d00032888ca3257c2c1a

Contents?: true

Size: 678 Bytes

Versions: 2

Compression:

Stored size: 678 Bytes

Contents

require 'roo_on_rails/config'

module RooOnRails
  module Railties
    class RooIdentity < Rails::Railtie
      initializer 'roo_on_rails.roo_identity.middleware' do |app|
        Rails.logger.with initializer: 'roo_on_rails.roo_identity' do |log|
          log.debug 'loading'
          _add_middleware(app, log)
        end
      end

      private

      def _add_middleware(app, log)
        require 'roo_on_rails/rack/populate_env_from_jwt'

        app.config.middleware.use RooOnRails::Rack::PopulateEnvFromJWT, logger: log
      rescue LoadError
        log.error 'the json-jwt gem is not in the bundle so Roo Identity will not be available'
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
roo_on_rails-1.16.0 lib/roo_on_rails/railties/roo_identity.rb
roo_on_rails-1.15.0 lib/roo_on_rails/railties/roo_identity.rb