Skip to content
This repository
Browse code

Make strategies scale as well (requires Warden 0.5.1)

  • Loading branch information...
commit 0b825958b217f435260e9b26041ba0effd4c56bc 1 parent ea2d76b
José Valim josevalim authored
2  README.rdoc
Source Rendered
@@ -27,7 +27,7 @@ All gems are on gemcutter, so you need to add gemcutter to your sources if you h
27 27
28 28 sudo gem sources -a http://gemcutter.org/
29 29
30   -Install warden gem if you don't have it installed (requires 0.5.0 or higher):
  30 +Install warden gem if you don't have it installed (requires 0.5.1 or higher):
31 31
32 32 sudo gem install warden
33 33
2  Rakefile
@@ -36,7 +36,7 @@ begin
36 36 s.description = "Flexible authentication solution for Rails with Warden"
37 37 s.authors = ['José Valim', 'Carlos Antônio']
38 38 s.files = FileList["[A-Z]*", "{app,config,lib}/**/*", "init.rb"]
39   - s.add_dependency("warden", "~> 0.5.0")
  39 + s.add_dependency("warden", "~> 0.5.1")
40 40 end
41 41
42 42 Jeweler::GemcutterTasks.new
1  lib/devise/models/authenticable.rb
... ... @@ -1,4 +1,5 @@
1 1 require 'digest/sha1'
  2 +require 'devise/strategies/authenticable'
2 3
3 4 module Devise
4 5 module Models
3  lib/devise/models/rememberable.rb
... ... @@ -1,5 +1,6 @@
1   -require 'devise/hooks/rememberable'
2 1 require 'digest/sha1'
  2 +require 'devise/hooks/rememberable'
  3 +require 'devise/strategies/rememberable'
3 4
4 5 module Devise
5 6 module Models
2  lib/devise/strategies/authenticable.rb
@@ -43,3 +43,5 @@ def sign_in_path
43 43 end
44 44 end
45 45 end
  46 +
  47 +Warden::Strategies.add(:authenticable, Devise::Strategies::Authenticable)
2  lib/devise/strategies/rememberable.rb
@@ -31,3 +31,5 @@ def remember_me_cookie
31 31 end
32 32 end
33 33 end
  34 +
  35 +Warden::Strategies.add(:rememberable, Devise::Strategies::Rememberable)
9 lib/devise/warden.rb
@@ -49,14 +49,13 @@ def cookies
49 49 env['warden'].request.params['action'] = 'new'
50 50 end
51 51
  52 +# Setup devise strategies for Warden
  53 +require 'devise/strategies/base'
  54 +
52 55 # Adds Warden Manager to Rails middleware stack, configuring default devise
53 56 # strategy and also the controller who will manage not authenticated users.
54 57 Rails.configuration.middleware.use Warden::Manager do |manager|
55 58 manager.default_strategies :rememberable, :authenticable
56 59 manager.failure_app = SessionsController
  60 + manager.silence_missing_strategies!
57 61 end
58   -
59   -# Setup devise strategies for Warden
60   -require 'devise/strategies/base'
61   -Warden::Strategies.add(:rememberable, Devise::Strategies::Rememberable)
62   -Warden::Strategies.add(:authenticable, Devise::Strategies::Authenticable)

0 comments on commit 0b82595

Please sign in to comment.
Something went wrong with that request. Please try again.