Module: Authie

Defined in:
lib/authie/rack_controller.rb,
lib/authie/user.rb,
lib/authie/error.rb,
lib/authie/config.rb,
lib/authie/engine.rb,
lib/authie/session.rb,
lib/authie/version.rb,
lib/authie/session_model.rb,
lib/authie/controller_delegate.rb,
lib/authie/controller_extension.rb

Overview

If you’re dealing with your authentication in a middleware and you only have access to your rack environment, this will wrap around rack and make it look close enough to an ActionController to work with Authie

Usage:

controller = Authie::RackController.new(@env) controller.current_user = user

Defined Under Namespace

Modules: ControllerExtension, User Classes: Config, ControllerDelegate, Engine, Error, RackController, Session, SessionModel

Constant Summary collapse

VERSION_FILE_ROOT =
File.expand_path('../../VERSION', __dir__)
VERSION =
if File.file?(VERSION_FILE_ROOT)
  File.read(VERSION_FILE_ROOT).strip.sub(/\Av/, '')
else
  '0.0.0.dev'
end

Class Method Summary collapse

Class Method Details

.configObject



31
32
33
# File 'lib/authie/config.rb', line 31

def config
  @config ||= Config.new
end

.configure(&block) ⇒ Object



35
36
37
38
# File 'lib/authie/config.rb', line 35

def configure(&block)
  block.call(config)
  config
end

.notify(event, args = {}, &block) ⇒ Object



40
41
42
# File 'lib/authie/config.rb', line 40

def notify(event, args = {}, &block)
  ActiveSupport::Notifications.instrument("#{event}.authie", args, &block)
end