devise 2.1.0.rc → 2.1.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of devise might be problematic. Click here for more details.

Files changed (65) hide show
  1. data/CHANGELOG.rdoc +23 -1
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +4 -6
  4. data/MIT-LICENSE +1 -1
  5. data/README.md +7 -3
  6. data/Rakefile +1 -1
  7. data/app/controllers/devise/sessions_controller.rb +2 -4
  8. data/app/controllers/devise/unlocks_controller.rb +15 -2
  9. data/app/controllers/devise_controller.rb +24 -11
  10. data/devise.gemspec +1 -1
  11. data/gemfiles/Gemfile.rails-3.1.x +1 -1
  12. data/gemfiles/Gemfile.rails-3.1.x.lock +38 -40
  13. data/lib/devise.rb +13 -55
  14. data/lib/devise/controllers/helpers.rb +0 -5
  15. data/lib/devise/failure_app.rb +3 -1
  16. data/lib/devise/hooks/lockable.rb +7 -0
  17. data/lib/devise/hooks/timeoutable.rb +1 -0
  18. data/lib/devise/models.rb +9 -3
  19. data/lib/devise/models/authenticatable.rb +13 -3
  20. data/lib/devise/models/confirmable.rb +2 -5
  21. data/lib/devise/models/database_authenticatable.rb +4 -6
  22. data/lib/devise/models/lockable.rb +6 -6
  23. data/lib/devise/models/rememberable.rb +3 -3
  24. data/lib/devise/models/token_authenticatable.rb +4 -1
  25. data/lib/devise/modules.rb +0 -1
  26. data/lib/devise/orm/active_record.rb +1 -42
  27. data/lib/devise/orm/mongoid.rb +1 -29
  28. data/lib/devise/rails.rb +1 -58
  29. data/lib/devise/rails/routes.rb +1 -1
  30. data/lib/devise/rails/warden_compat.rb +10 -4
  31. data/lib/devise/strategies/rememberable.rb +1 -1
  32. data/lib/devise/test_helpers.rb +48 -9
  33. data/lib/devise/version.rb +1 -1
  34. data/lib/generators/active_record/devise_generator.rb +8 -4
  35. data/lib/generators/devise/orm_helpers.rb +2 -1
  36. data/lib/generators/mongoid/devise_generator.rb +0 -3
  37. data/lib/generators/templates/devise.rb +1 -8
  38. data/test/controllers/custom_strategy_test.rb +62 -0
  39. data/test/controllers/sessions_controller_test.rb +21 -1
  40. data/test/failure_app_test.rb +13 -3
  41. data/test/generators/active_record_generator_test.rb +32 -0
  42. data/test/integration/authenticatable_test.rb +2 -2
  43. data/test/integration/recoverable_test.rb +13 -0
  44. data/test/integration/token_authenticatable_test.rb +13 -0
  45. data/test/models/lockable_test.rb +0 -9
  46. data/test/models/rememberable_test.rb +1 -2
  47. data/test/models_test.rb +5 -5
  48. data/test/rails_app/app/mongoid/admin.rb +0 -3
  49. data/test/rails_app/app/mongoid/user.rb +0 -3
  50. data/test/rails_app/config/initializers/devise.rb +0 -15
  51. data/test/rails_app/config/routes.rb +1 -0
  52. data/test/rails_app/db/migrate/20100401102949_create_tables.rb +0 -6
  53. data/test/rails_app/lib/shared_admin.rb +1 -1
  54. metadata +17 -24
  55. data/lib/devise/encryptors/authlogic_sha512.rb +0 -19
  56. data/lib/devise/encryptors/base.rb +0 -24
  57. data/lib/devise/encryptors/bcrypt.rb +0 -14
  58. data/lib/devise/encryptors/clearance_sha1.rb +0 -17
  59. data/lib/devise/encryptors/restful_authentication_sha1.rb +0 -22
  60. data/lib/devise/encryptors/sha1.rb +0 -25
  61. data/lib/devise/encryptors/sha512.rb +0 -25
  62. data/lib/devise/models/encryptable.rb +0 -80
  63. data/lib/devise/schema.rb +0 -109
  64. data/test/encryptors_test.rb +0 -30
  65. data/test/models/encryptable_test.rb +0 -73
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,24 @@
1
- == 2.1.0.dev
1
+ == trunk (2.1.0.rc2)
2
+
3
+ * enhancements
4
+ * Devise model generator now works with engines
5
+ * Devise encryptable was moved to its new gem (http://github.com/plataformatec/devise-encryptable)
6
+
7
+ * deprecations
8
+ * Deprecations warnings added on Devise 2.0 are now removed with their features
9
+ * use_salt_as_remember_token and apply_schema does not have any effect since 2.0 and are now deprecated
10
+ * valid_for_authentication? must now return a boolean
11
+
12
+ * bug fix
13
+ * Ensure the failure app still respects config.relative_url_root
14
+ * `/users/sign_in` doesn't choke on protected attributes used to select sign in scope (by @Paymium)
15
+ * `failed_attempts` is set to zero after any sign in (including via reset password) (by @rodrigoflores)
16
+ * Added token expiration on timeout (by @antiarchitect)
17
+ * Do not accidentally mark `_prefixes` as private
18
+ * Better support for custom strategies on test helpers (by @mattconnolly)
19
+ * Return `head :no_content` in SessionsController now that most JS libraries handle it (by @julianvargasalvarez)
20
+
21
+ == 2.1.0.rc
2
22
 
3
23
  * enhancements
4
24
  * Add check_fields! method on Devise::Models to check if the model includes the fields that Devise uses
@@ -7,6 +27,7 @@
7
27
  * bug fix
8
28
  * Ensure after sign in hook is not called without a resource
9
29
  * Fix a term: now on Omniauth related flash messages, we say that we're authenticating from an omniauth provider instead of authorizing
30
+ * Fixed redirect when authenticated mounted apps (by @hakanensari)
10
31
 
11
32
  * deprecation
12
33
  * All devise modules should have a required_fields(klass) module method to help gathering missing attributes
@@ -72,6 +93,7 @@ Notes: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.
72
93
  * Move devise/shared/_links.erb to devise/_links.erb
73
94
  * Deprecated support of nested devise_for blocks
74
95
  * Deprecated support to devise.registrations.reasons and devise.registrations.inactive_signed_up in favor of devise.registrations.signed_up_but_*
96
+ * Protected method render_with_scope was removed.
75
97
 
76
98
  == 1.5.3
77
99
 
data/Gemfile CHANGED
@@ -25,7 +25,7 @@ platforms :jruby do
25
25
  end
26
26
 
27
27
  platforms :ruby do
28
- gem "sqlite3-ruby"
28
+ gem "sqlite3"
29
29
 
30
30
  group :mongoid do
31
31
  gem "mongo", "~> 1.3.0"
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- devise (2.0.4)
4
+ devise (2.1.0.rc)
5
5
  bcrypt-ruby (~> 3.0)
6
- orm_adapter (~> 0.0.3)
6
+ orm_adapter (~> 0.0.7)
7
7
  railties (~> 3.1)
8
8
  warden (~> 1.1.1)
9
9
 
@@ -87,7 +87,7 @@ GEM
87
87
  omniauth-openid (1.0.1)
88
88
  omniauth (~> 1.0)
89
89
  rack-openid (~> 1.3.1)
90
- orm_adapter (0.0.6)
90
+ orm_adapter (0.0.7)
91
91
  polyglot (0.3.3)
92
92
  rack (1.4.1)
93
93
  rack-cache (1.1)
@@ -129,8 +129,6 @@ GEM
129
129
  rack (~> 1.0)
130
130
  tilt (~> 1.1, != 1.3.0)
131
131
  sqlite3 (1.3.5)
132
- sqlite3-ruby (1.3.3)
133
- sqlite3 (>= 1.3.3)
134
132
  thor (0.14.6)
135
133
  tilt (1.3.3)
136
134
  treetop (1.4.10)
@@ -163,5 +161,5 @@ DEPENDENCIES
163
161
  rails (~> 3.2.0)
164
162
  rdoc
165
163
  ruby-debug (>= 0.10.3)
166
- sqlite3-ruby
164
+ sqlite3
167
165
  webrat (= 0.7.2)
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2009-2012 Plataforma Tecnologia. http://blog.plataformatec.com.br
1
+ Copyright 2009-2012 Plataformatec. http://plataformatec.com.br
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ *IMPORTANT:* Devise 2.1 is out. If you are upgrading, please read: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.1
2
+
1
3
  *IMPORTANT:* Devise 2.0 is out. If you are upgrading, please read: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0
2
4
 
3
5
  ## Devise
@@ -42,7 +44,7 @@ If you discover a problem with Devise, we would like to know about it. However,
42
44
 
43
45
  https://github.com/plataformatec/devise/wiki/Bug-reports
44
46
 
45
- If you found a security bug, do *NOT* use the GitHub issue tracker. Send email or a private GitHub message to the maintainers listed at the bottom of the README.
47
+ If you found a security bug, do *NOT* use the GitHub issue tracker. Send an email to the maintainers listed at the bottom of the README.
46
48
 
47
49
  ### Mailing list
48
50
 
@@ -91,7 +93,9 @@ Once you have solidified your understanding of Rails and authentication mechanis
91
93
 
92
94
  Devise 2.0 works with Rails 3.1 onwards. You can add it to your Gemfile with:
93
95
 
94
- gem 'devise'
96
+ ```ruby
97
+ gem 'devise'
98
+ ```
95
99
 
96
100
  Run the bundle command to install it.
97
101
 
@@ -379,4 +383,4 @@ https://github.com/plataformatec/devise/contributors
379
383
 
380
384
  ## License
381
385
 
382
- MIT License. Copyright 2012 Plataforma Tecnologia. http://blog.plataformatec.com.br
386
+ MIT License. Copyright 2012 Plataformatec. http://plataformatec.com.br
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: UTF-8
2
-
2
+ require "bundler/gem_tasks"
3
3
  require 'rake/testtask'
4
4
  require 'rdoc/task'
5
5
 
@@ -4,7 +4,7 @@ class Devise::SessionsController < DeviseController
4
4
 
5
5
  # GET /resource/sign_in
6
6
  def new
7
- resource = build_resource
7
+ resource = build_resource(nil, :unsafe => true)
8
8
  clean_up_passwords(resource)
9
9
  respond_with(resource, serialize_options(resource))
10
10
  end
@@ -28,9 +28,7 @@ class Devise::SessionsController < DeviseController
28
28
  respond_to do |format|
29
29
  format.any(*navigational_formats) { redirect_to redirect_path }
30
30
  format.all do
31
- method = "to_#{request_format}"
32
- text = {}.respond_to?(method) ? {}.send(method) : ""
33
- render :text => text, :status => :ok
31
+ head :no_content
34
32
  end
35
33
  end
36
34
  end
@@ -11,7 +11,7 @@ class Devise::UnlocksController < DeviseController
11
11
  self.resource = resource_class.send_unlock_instructions(params[resource_name])
12
12
 
13
13
  if successfully_sent?(resource)
14
- respond_with({}, :location => new_session_path(resource_name))
14
+ respond_with({}, :location => after_sending_unlock_instructions_path_for(resource))
15
15
  else
16
16
  respond_with(resource)
17
17
  end
@@ -23,9 +23,22 @@ class Devise::UnlocksController < DeviseController
23
23
 
24
24
  if resource.errors.empty?
25
25
  set_flash_message :notice, :unlocked if is_navigational_format?
26
- respond_with_navigational(resource){ redirect_to new_session_path(resource) }
26
+ respond_with_navigational(resource){ redirect_to after_unlock_path_for(resource) }
27
27
  else
28
28
  respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render :new }
29
29
  end
30
30
  end
31
+
32
+ protected
33
+
34
+ # The path used after sending unlock password instructions
35
+ def after_sending_unlock_instructions_path_for(resource)
36
+ new_session_path(resource)
37
+ end
38
+
39
+ # The path used after unlocking the resource
40
+ def after_unlock_path_for(resource)
41
+ new_session_path(resource)
42
+ end
43
+
31
44
  end
@@ -38,6 +38,17 @@ class DeviseController < Devise.parent_controller.constantize
38
38
  @devise_mapping ||= request.env["devise.mapping"]
39
39
  end
40
40
 
41
+ # Override prefixes to consider the scoped view.
42
+ def _prefixes #:nodoc:
43
+ @_prefixes ||= if self.class.scoped_views? && devise_mapping
44
+ super.unshift("#{devise_mapping.scoped_path}/#{controller_name}")
45
+ else
46
+ super
47
+ end
48
+ end
49
+
50
+ hide_action :_prefixes
51
+
41
52
  protected
42
53
 
43
54
  # Checks whether it's a devise mapped resource or not.
@@ -68,9 +79,20 @@ MESSAGE
68
79
  end
69
80
 
70
81
  # Build a devise resource.
71
- def build_resource(hash=nil)
82
+ # Assignment bypasses attribute protection when :unsafe option is passed
83
+ def build_resource(hash = nil, options = {})
72
84
  hash ||= params[resource_name] || {}
73
- self.resource = resource_class.new(hash)
85
+
86
+ if options[:unsafe]
87
+ self.resource = resource_class.new.tap do |resource|
88
+ hash.each do |key, value|
89
+ setter = :"#{key}="
90
+ resource.send(setter, value) if resource.respond_to?(setter)
91
+ end
92
+ end
93
+ else
94
+ self.resource = resource_class.new(hash)
95
+ end
74
96
  end
75
97
 
76
98
  # Helper for use in before_filters where no authentication is required.
@@ -152,13 +174,4 @@ MESSAGE
152
174
  def is_navigational_format?
153
175
  Devise.navigational_formats.include?(request.format.try(:ref))
154
176
  end
155
-
156
- # Override prefixes to consider the scoped view.
157
- def _prefixes #:nodoc:
158
- @_prefixes ||= if self.class.scoped_views? && devise_mapping
159
- super.unshift("#{devise_mapping.scoped_path}/#{controller_name}")
160
- else
161
- super
162
- end
163
- end
164
177
  end
data/devise.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.add_dependency("warden", "~> 1.1.1")
22
- s.add_dependency("orm_adapter", "~> 0.0.3")
22
+ s.add_dependency("orm_adapter", "~> 0.0.7")
23
23
  s.add_dependency("bcrypt-ruby", "~> 3.0")
24
24
  s.add_dependency("railties", "~> 3.1")
25
25
  end
@@ -25,7 +25,7 @@ platforms :jruby do
25
25
  end
26
26
 
27
27
  platforms :ruby do
28
- gem "sqlite3-ruby"
28
+ gem "sqlite3"
29
29
 
30
30
  group :mongoid do
31
31
  gem "mongo", "~> 1.3.0"
@@ -1,45 +1,45 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- devise (2.0.2)
4
+ devise (2.1.0.rc2)
5
5
  bcrypt-ruby (~> 3.0)
6
- orm_adapter (~> 0.0.3)
6
+ orm_adapter (~> 0.0.7)
7
7
  railties (~> 3.1)
8
8
  warden (~> 1.1.1)
9
9
 
10
10
  GEM
11
11
  remote: http://rubygems.org/
12
12
  specs:
13
- actionmailer (3.1.3)
14
- actionpack (= 3.1.3)
13
+ actionmailer (3.1.4)
14
+ actionpack (= 3.1.4)
15
15
  mail (~> 2.3.0)
16
- actionpack (3.1.3)
17
- activemodel (= 3.1.3)
18
- activesupport (= 3.1.3)
16
+ actionpack (3.1.4)
17
+ activemodel (= 3.1.4)
18
+ activesupport (= 3.1.4)
19
19
  builder (~> 3.0.0)
20
20
  erubis (~> 2.7.0)
21
21
  i18n (~> 0.6)
22
- rack (~> 1.3.5)
22
+ rack (~> 1.3.6)
23
23
  rack-cache (~> 1.1)
24
24
  rack-mount (~> 0.8.2)
25
25
  rack-test (~> 0.6.1)
26
26
  sprockets (~> 2.0.3)
27
- activemodel (3.1.3)
28
- activesupport (= 3.1.3)
27
+ activemodel (3.1.4)
28
+ activesupport (= 3.1.4)
29
29
  builder (~> 3.0.0)
30
30
  i18n (~> 0.6)
31
- activerecord (3.1.3)
32
- activemodel (= 3.1.3)
33
- activesupport (= 3.1.3)
34
- arel (~> 2.2.1)
31
+ activerecord (3.1.4)
32
+ activemodel (= 3.1.4)
33
+ activesupport (= 3.1.4)
34
+ arel (~> 2.2.3)
35
35
  tzinfo (~> 0.3.29)
36
- activeresource (3.1.3)
37
- activemodel (= 3.1.3)
38
- activesupport (= 3.1.3)
39
- activesupport (3.1.3)
36
+ activeresource (3.1.4)
37
+ activemodel (= 3.1.4)
38
+ activesupport (= 3.1.4)
39
+ activesupport (3.1.4)
40
40
  multi_json (~> 1.0)
41
41
  addressable (2.2.7)
42
- arel (2.2.1)
42
+ arel (2.2.3)
43
43
  bcrypt-ruby (3.0.1)
44
44
  bson (1.5.2)
45
45
  bson_ext (1.3.1)
@@ -53,15 +53,15 @@ GEM
53
53
  hashie (1.2.0)
54
54
  hike (1.2.1)
55
55
  i18n (0.6.0)
56
- json (1.6.5)
56
+ json (1.7.0)
57
57
  linecache (0.46)
58
58
  rbx-require-relative (> 0.0.4)
59
- mail (2.3.0)
59
+ mail (2.3.3)
60
60
  i18n (>= 0.4.0)
61
61
  mime-types (~> 1.16)
62
62
  treetop (~> 1.4.8)
63
63
  metaclass (0.0.1)
64
- mime-types (1.17.2)
64
+ mime-types (1.18)
65
65
  mocha (0.10.4)
66
66
  metaclass (~> 0.0.1)
67
67
  mongo (1.3.1)
@@ -70,7 +70,7 @@ GEM
70
70
  activemodel (~> 3.1)
71
71
  mongo (~> 1.3)
72
72
  tzinfo (~> 0.3.22)
73
- multi_json (1.0.4)
73
+ multi_json (1.3.4)
74
74
  multipart-post (1.1.5)
75
75
  nokogiri (1.5.0)
76
76
  oauth2 (0.5.2)
@@ -87,10 +87,10 @@ GEM
87
87
  omniauth-openid (1.0.1)
88
88
  omniauth (~> 1.0)
89
89
  rack-openid (~> 1.3.1)
90
- orm_adapter (0.0.6)
90
+ orm_adapter (0.0.7)
91
91
  polyglot (0.3.3)
92
92
  rack (1.3.6)
93
- rack-cache (1.1)
93
+ rack-cache (1.2)
94
94
  rack (>= 0.4)
95
95
  rack-mount (0.8.3)
96
96
  rack (>= 1.0.0)
@@ -101,17 +101,17 @@ GEM
101
101
  rack
102
102
  rack-test (0.6.1)
103
103
  rack (>= 1.0)
104
- rails (3.1.3)
105
- actionmailer (= 3.1.3)
106
- actionpack (= 3.1.3)
107
- activerecord (= 3.1.3)
108
- activeresource (= 3.1.3)
109
- activesupport (= 3.1.3)
104
+ rails (3.1.4)
105
+ actionmailer (= 3.1.4)
106
+ actionpack (= 3.1.4)
107
+ activerecord (= 3.1.4)
108
+ activeresource (= 3.1.4)
109
+ activesupport (= 3.1.4)
110
110
  bundler (~> 1.0)
111
- railties (= 3.1.3)
112
- railties (3.1.3)
113
- actionpack (= 3.1.3)
114
- activesupport (= 3.1.3)
111
+ railties (= 3.1.4)
112
+ railties (3.1.4)
113
+ actionpack (= 3.1.4)
114
+ activesupport (= 3.1.4)
115
115
  rack-ssl (~> 1.3.2)
116
116
  rake (>= 0.8.7)
117
117
  rdoc (~> 3.4)
@@ -126,19 +126,17 @@ GEM
126
126
  ruby-debug-base (0.10.4)
127
127
  linecache (>= 0.3)
128
128
  ruby-openid (2.1.8)
129
- sprockets (2.0.3)
129
+ sprockets (2.0.4)
130
130
  hike (~> 1.2)
131
131
  rack (~> 1.0)
132
132
  tilt (~> 1.1, != 1.3.0)
133
133
  sqlite3 (1.3.5)
134
- sqlite3-ruby (1.3.3)
135
- sqlite3 (>= 1.3.3)
136
134
  thor (0.14.6)
137
135
  tilt (1.3.3)
138
136
  treetop (1.4.10)
139
137
  polyglot
140
138
  polyglot (>= 0.3.1)
141
- tzinfo (0.3.31)
139
+ tzinfo (0.3.33)
142
140
  warden (1.1.1)
143
141
  rack (>= 1.0)
144
142
  webrat (0.7.2)
@@ -165,5 +163,5 @@ DEPENDENCIES
165
163
  rails (~> 3.1.0)
166
164
  rdoc
167
165
  ruby-debug (>= 0.10.3)
168
- sqlite3-ruby
166
+ sqlite3
169
167
  webrat (= 0.7.2)
data/lib/devise.rb CHANGED
@@ -20,16 +20,6 @@ module Devise
20
20
  autoload :UrlHelpers, 'devise/controllers/url_helpers'
21
21
  end
22
22
 
23
- module Encryptors
24
- autoload :Base, 'devise/encryptors/base'
25
- autoload :AuthlogicSha512, 'devise/encryptors/authlogic_sha512'
26
- autoload :BCrypt, 'devise/encryptors/bcrypt'
27
- autoload :ClearanceSha1, 'devise/encryptors/clearance_sha1'
28
- autoload :RestfulAuthenticationSha1, 'devise/encryptors/restful_authentication_sha1'
29
- autoload :Sha512, 'devise/encryptors/sha512'
30
- autoload :Sha1, 'devise/encryptors/sha1'
31
- end
32
-
33
23
  module Mailers
34
24
  autoload :Helpers, 'devise/mailers/helpers'
35
25
  end
@@ -53,15 +43,6 @@ module Devise
53
43
  # True values used to check params
54
44
  TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE']
55
45
 
56
- # Declare encryptors length which are used in migrations.
57
- ENCRYPTORS_LENGTH = {
58
- :sha1 => 40,
59
- :sha512 => 128,
60
- :clearance_sha1 => 40,
61
- :restful_authentication_sha1 => 40,
62
- :authlogic_sha512 => 128
63
- }
64
-
65
46
  # Custom domain for cookies. Not set by default
66
47
  mattr_accessor :rememberable_options
67
48
  @@rememberable_options = {}
@@ -79,14 +60,12 @@ module Devise
79
60
  @@request_keys = []
80
61
 
81
62
  # Keys that should be case-insensitive.
82
- # False by default for backwards compatibility.
83
63
  mattr_accessor :case_insensitive_keys
84
- @@case_insensitive_keys = false
64
+ @@case_insensitive_keys = [ :email ]
85
65
 
86
66
  # Keys that should have whitespace stripped.
87
- # False by default for backwards compatibility.
88
67
  mattr_accessor :strip_whitespace_keys
89
- @@strip_whitespace_keys = false
68
+ @@strip_whitespace_keys = []
90
69
 
91
70
  # If http authentication is enabled by default.
92
71
  mattr_accessor :http_authenticatable
@@ -139,14 +118,14 @@ module Devise
139
118
  mattr_accessor :timeout_in
140
119
  @@timeout_in = 30.minutes
141
120
 
121
+ # Authentication token expiration on timeout
122
+ mattr_accessor :expire_auth_token_on_timeout
123
+ @@expire_auth_token_on_timeout = false
124
+
142
125
  # Used to encrypt password. Please generate one with rake secret.
143
126
  mattr_accessor :pepper
144
127
  @@pepper = nil
145
128
 
146
- # Used to define the password encryption algorithm.
147
- mattr_accessor :encryptor
148
- @@encryptor = nil
149
-
150
129
  # Scoped views. Since it relies on fallbacks to render default views, it's
151
130
  # turned off by default.
152
131
  mattr_accessor :scoped_views
@@ -179,9 +158,8 @@ module Devise
179
158
  @@reset_password_keys = [ :email ]
180
159
 
181
160
  # Time interval you can reset your password with a reset password key
182
- # Nil by default for backwards compatibility.
183
161
  mattr_accessor :reset_password_within
184
- @@reset_password_within = nil
162
+ @@reset_password_within = 6.hours
185
163
 
186
164
  # The default scope which is used by warden.
187
165
  mattr_accessor :default_scope
@@ -223,36 +201,16 @@ module Devise
223
201
  mattr_accessor :router_name
224
202
  @@router_name = nil
225
203
 
226
- # DEPRECATED CONFIG
227
-
228
- # If true, uses salt as remember token and does not create it in the database.
229
- # By default is false for backwards compatibility.
230
- mattr_accessor :use_salt_as_remember_token
231
- @@use_salt_as_remember_token = false
232
-
233
- # Tells if devise should apply the schema in ORMs where devise declaration
234
- # and schema belongs to the same class (as Datamapper and Mongoid).
235
- mattr_accessor :apply_schema
236
- @@apply_schema = true
237
-
238
- def self.remember_across_browsers=(value)
239
- warn "\n[DEVISE] Devise.remember_across_browsers is deprecated and has no effect. Please remove it.\n"
240
- end
241
-
242
- def self.confirm_within=(value)
243
- warn "\n[DEVISE] Devise.confirm_within= is deprecated. Please set Devise.allow_unconfirmed_access_for= instead.\n"
244
- Devise.allow_unconfirmed_access_for = value
204
+ def self.encryptor=(value)
205
+ warn "\n[DEVISE] To select a encryption which isn't bcrypt, you should use devise-encryptable gem.\n"
245
206
  end
246
207
 
247
- def self.cookie_options=(value)
248
- warn "\n[DEVISE] Devise.cookie_options= is deprecated. Please set Devise.rememberable_options= instead.\n"
249
- Devise.rememberable_options = value
208
+ def self.use_salt_as_remember_token=(value)
209
+ warn "\n[DEVISE] Devise.use_salt_as_remember_token is deprecated and has no effect. Please remove it.\n"
250
210
  end
251
211
 
252
- def self.stateless_token=(value)
253
- warn "\n[DEVISE] Devise.stateless_token= is deprecated. Please append :token_auth to Devise.skip_session_storage " \
254
- "instead, for example: Devise.skip_session_storage << :token_auth\n"
255
- Devise.skip_session_storage << :token_auth
212
+ def self.apply_schema=(value)
213
+ warn "\n[DEVISE] Devise.apply_schema is deprecated and has no effect. Please remove it.\n"
256
214
  end
257
215
 
258
216
  # PRIVATE CONFIGURATION