Permalink
Browse files

Make strategies scale as well (requires Warden 0.5.1)

  • Loading branch information...
1 parent ea2d76b commit 0b825958b217f435260e9b26041ba0effd4c56bc @josevalim josevalim committed Oct 22, 2009
View
@@ -27,7 +27,7 @@ All gems are on gemcutter, so you need to add gemcutter to your sources if you h
sudo gem sources -a http://gemcutter.org/
-Install warden gem if you don't have it installed (requires 0.5.0 or higher):
+Install warden gem if you don't have it installed (requires 0.5.1 or higher):
sudo gem install warden
View
@@ -36,7 +36,7 @@ begin
s.description = "Flexible authentication solution for Rails with Warden"
s.authors = ['José Valim', 'Carlos Antônio']
s.files = FileList["[A-Z]*", "{app,config,lib}/**/*", "init.rb"]
- s.add_dependency("warden", "~> 0.5.0")
+ s.add_dependency("warden", "~> 0.5.1")
end
Jeweler::GemcutterTasks.new
@@ -1,4 +1,5 @@
require 'digest/sha1'
+require 'devise/strategies/authenticable'
module Devise
module Models
@@ -1,5 +1,6 @@
-require 'devise/hooks/rememberable'
require 'digest/sha1'
+require 'devise/hooks/rememberable'
+require 'devise/strategies/rememberable'
module Devise
module Models
@@ -43,3 +43,5 @@ def sign_in_path
end
end
end
+
+Warden::Strategies.add(:authenticable, Devise::Strategies::Authenticable)
@@ -31,3 +31,5 @@ def remember_me_cookie
end
end
end
+
+Warden::Strategies.add(:rememberable, Devise::Strategies::Rememberable)
View
@@ -49,14 +49,13 @@ def cookies
env['warden'].request.params['action'] = 'new'
end
+# Setup devise strategies for Warden
+require 'devise/strategies/base'
+
# Adds Warden Manager to Rails middleware stack, configuring default devise
# strategy and also the controller who will manage not authenticated users.
Rails.configuration.middleware.use Warden::Manager do |manager|
manager.default_strategies :rememberable, :authenticable
manager.failure_app = SessionsController
+ manager.silence_missing_strategies!
end
-
-# Setup devise strategies for Warden
-require 'devise/strategies/base'
-Warden::Strategies.add(:rememberable, Devise::Strategies::Rememberable)
-Warden::Strategies.add(:authenticable, Devise::Strategies::Authenticable)

0 comments on commit 0b82595

Please sign in to comment.