class Rodauth::Rails::Middleware

Middleware that's added to the Rails middleware stack. Normally the main Roda app could be used directly, but this trick allows the app class to be reloadable.

Public Class Methods

new(app) click to toggle source
# File lib/rodauth/rails/middleware.rb, line 7
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/rodauth/rails/middleware.rb, line 11
def call(env)
  app = Rodauth::Rails.app.new(@app)

  # allow the Rails app to call Rodauth methods that throw :halt
  catch(:halt) do
    app.call(env)
  end
end