Sha256: bf9193385a278f84bf3f86732ea65d386b71bf8780aa3b9f08737b84bacacb02

Contents?: true

Size: 470 Bytes

Versions: 8

Compression:

Stored size: 470 Bytes

Contents

class MetryAuthenticator
  include ActionController::UrlWriter

  def initialize(env)
    extend LoginSystem
    @env = env
    @request = Rack::Request.new(env)
    def @request.format
      nil
    end
  end
  
  attr_reader :request
  
  def cookies
    request.cookies
  end
  
  def session
    @env["rack.session"]
  end
      
  def authorized?
    (current_user && current_user.admin?)
  end
  
  def redirect
    [302, {"Location" => login_path}, ""]
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
metry-2.0.4 radiant/extension/lib/metry_authenticator.rb
metry-2.0.5 radiant/extension/lib/metry_authenticator.rb
metry-2.1.0 radiant/extension/lib/metry_authenticator.rb
metry-2.1.1 radiant/extension/lib/metry_authenticator.rb
metry-2.0.0 radiant/extension/lib/metry_authenticator.rb
metry-2.0.1 radiant/extension/lib/metry_authenticator.rb
metry-2.0.2 radiant/extension/lib/metry_authenticator.rb
metry-2.0.3 radiant/extension/lib/metry_authenticator.rb