From 1ae3754fb55d8806e48fb92810804a4d1dc2826e Mon Sep 17 00:00:00 2001 From: f Date: Mon, 8 Apr 2019 15:01:05 -0300 Subject: [PATCH] cargar warden automaticamente --- app/lib/warden/email_and_password.rb | 6 ++++++ .../lib/warden/email_and_password/strategy.rb | 0 app/lib/warden/imap.rb | 6 ++++++ lib/warden/imap.rb => app/lib/warden/imap/strategy.rb | 0 config/initializers/warden.rb | 3 --- 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 app/lib/warden/email_and_password.rb rename lib/warden/email_and_password.rb => app/lib/warden/email_and_password/strategy.rb (100%) create mode 100644 app/lib/warden/imap.rb rename lib/warden/imap.rb => app/lib/warden/imap/strategy.rb (100%) diff --git a/app/lib/warden/email_and_password.rb b/app/lib/warden/email_and_password.rb new file mode 100644 index 0000000..957770d --- /dev/null +++ b/app/lib/warden/email_and_password.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Warden + module EmailAndPassword + end +end diff --git a/lib/warden/email_and_password.rb b/app/lib/warden/email_and_password/strategy.rb similarity index 100% rename from lib/warden/email_and_password.rb rename to app/lib/warden/email_and_password/strategy.rb diff --git a/app/lib/warden/imap.rb b/app/lib/warden/imap.rb new file mode 100644 index 0000000..fe435be --- /dev/null +++ b/app/lib/warden/imap.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +module Warden + module IMAP + end +end diff --git a/lib/warden/imap.rb b/app/lib/warden/imap/strategy.rb similarity index 100% rename from lib/warden/imap.rb rename to app/lib/warden/imap/strategy.rb diff --git a/config/initializers/warden.rb b/config/initializers/warden.rb index b527966..9af19d0 100644 --- a/config/initializers/warden.rb +++ b/config/initializers/warden.rb @@ -1,8 +1,5 @@ # frozen_string_literal: true -require 'warden/imap' -require 'warden/email_and_password' - Rails.configuration.middleware.use RailsWarden::Manager do |manager| manager.default_strategies :email, :imap manager.failure_app = ->(env) { LoginController.action(:new).call(env) }