Sha256: 148e3faaf9e304268c7af8f7dd6f6c17f9bb61396888fd35c7f5242e83f63299
Contents?: true
Size: 519 Bytes
Versions: 13
Compression:
Stored size: 519 Bytes
Contents
require 'rhoconnect/middleware/helpers' module Rhoconnect module Middleware class LoginRequired def initialize(app) @app = app end def call(env) begin if Rhoconnect.is_login_required(env) raise LoginException.new("Not authenticated") if env[Rhoconnect::CURRENT_USER].nil? end @app.call(env) rescue LoginException => le return [401, {'Content-Type' => 'text/plain'}, le.message] end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems