Sha256: ae576be82ae292e56a2e0e7842bb3a14a373bb5e13ac63cc893f7e6324047d4f

Contents?: true

Size: 864 Bytes

Versions: 1

Compression:

Stored size: 864 Bytes

Contents

# frozen_string_literal: true

require_relative File.join(__FILE__, "..", "..", "..", "lib", "strategies", "database_authentication.rb")
Rails.application.config.middleware.use Warden::Manager do |manager|
  manager.default_strategies :database_authentication

  # TODO: Setup warden's failure app, this will be called everytime that
  # and authentication failure happen.
  # Failure app should be a Rack application.
  # In Rails a controller can be used as a Rack app, just specify the
  # controller and the action to be called. Example:
  manager.failure_app = lambda { |env| SessionsController.action(:new).call(env) }
end

Warden::Manager.serialize_into_session(:<%= resource_name %>) do |<%= resource_name %>|
  <%= resource_name %>.id
end

Warden::Manager.serialize_from_session(:<%= resource_name %>) do |id|
  <%= resource_name.classify %>.find(id)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mac_generators-0.3.1 lib/generators/authentication/email/templates/warden.rb