devise 1.5.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.rdoc +104 -70
- data/MIT-LICENSE +1 -1
- data/README.rdoc +4 -2
- data/app/controllers/devise/confirmations_controller.rb +3 -6
- data/app/controllers/devise/omniauth_callbacks_controller.rb +1 -3
- data/app/controllers/devise/passwords_controller.rb +3 -6
- data/app/controllers/devise/registrations_controller.rb +40 -42
- data/app/controllers/devise/sessions_controller.rb +2 -3
- data/app/controllers/devise/unlocks_controller.rb +4 -7
- data/app/controllers/devise_controller.rb +169 -0
- data/app/views/devise/_links.erb +25 -0
- data/app/views/devise/confirmations/new.html.erb +1 -1
- data/app/views/devise/mailer/confirmation_instructions.html.erb +1 -1
- data/app/views/devise/passwords/edit.html.erb +1 -1
- data/app/views/devise/passwords/new.html.erb +1 -1
- data/app/views/devise/registrations/new.html.erb +1 -1
- data/app/views/devise/sessions/new.html.erb +1 -1
- data/app/views/devise/shared/_links.erb +3 -25
- data/app/views/devise/unlocks/new.html.erb +1 -1
- data/config/locales/en.yml +5 -6
- data/lib/devise/controllers/helpers.rb +8 -2
- data/lib/devise/controllers/scoped_views.rb +0 -16
- data/lib/devise/controllers/url_helpers.rb +16 -2
- data/lib/devise/delegator.rb +2 -2
- data/lib/devise/failure_app.rb +43 -8
- data/lib/devise/mapping.rb +1 -4
- data/lib/devise/models/authenticatable.rb +22 -1
- data/lib/devise/models/confirmable.rb +80 -22
- data/lib/devise/models/database_authenticatable.rb +0 -11
- data/lib/devise/models/lockable.rb +1 -1
- data/lib/devise/models/recoverable.rb +5 -5
- data/lib/devise/models/rememberable.rb +5 -20
- data/lib/devise/models/serializable.rb +5 -2
- data/lib/devise/models/timeoutable.rb +1 -3
- data/lib/devise/models/token_authenticatable.rb +1 -4
- data/lib/devise/models/validatable.rb +1 -1
- data/lib/devise/models.rb +1 -1
- data/lib/devise/modules.rb +2 -2
- data/lib/devise/orm/active_record.rb +6 -0
- data/lib/devise/param_filter.rb +1 -1
- data/lib/devise/path_checker.rb +7 -2
- data/lib/devise/rails/routes.rb +23 -14
- data/lib/devise/rails/warden_compat.rb +0 -83
- data/lib/devise/rails.rb +61 -0
- data/lib/devise/schema.rb +5 -0
- data/lib/devise/strategies/authenticatable.rb +14 -10
- data/lib/devise/strategies/token_authenticatable.rb +3 -3
- data/lib/devise/version.rb +1 -1
- data/lib/devise.rb +56 -33
- data/lib/generators/active_record/devise_generator.rb +40 -2
- data/lib/generators/active_record/templates/migration.rb +1 -19
- data/lib/generators/active_record/templates/migration_existing.rb +1 -9
- data/lib/generators/devise/views_generator.rb +6 -14
- data/lib/generators/mongoid/devise_generator.rb +43 -0
- data/lib/generators/templates/devise.rb +26 -12
- data/lib/generators/templates/simple_form_for/confirmations/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/passwords/edit.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/passwords/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/registrations/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/sessions/new.html.erb +1 -1
- data/lib/generators/templates/simple_form_for/unlocks/new.html.erb +1 -1
- data/test/controllers/internal_helpers_test.rb +5 -4
- data/test/delegator_test.rb +19 -0
- data/test/devise_test.rb +2 -2
- data/test/failure_app_test.rb +24 -20
- data/test/generators/active_record_generator_test.rb +3 -13
- data/test/generators/views_generator_test.rb +1 -1
- data/test/integration/authenticatable_test.rb +4 -7
- data/test/integration/confirmable_test.rb +55 -3
- data/test/integration/http_authenticatable_test.rb +20 -5
- data/test/integration/lockable_test.rb +26 -14
- data/test/integration/registerable_test.rb +33 -2
- data/test/integration/rememberable_test.rb +0 -50
- data/test/integration/timeoutable_test.rb +18 -4
- data/test/integration/token_authenticatable_test.rb +5 -5
- data/test/integration/trackable_test.rb +6 -6
- data/test/mapping_test.rb +2 -3
- data/test/models/confirmable_test.rb +101 -8
- data/test/models/database_authenticatable_test.rb +6 -0
- data/test/models/encryptable_test.rb +1 -1
- data/test/models/lockable_test.rb +13 -0
- data/test/models/recoverable_test.rb +0 -27
- data/test/models/rememberable_test.rb +41 -160
- data/test/models/serializable_test.rb +1 -1
- data/test/models_test.rb +7 -7
- data/test/path_checker_test.rb +21 -0
- data/test/rails_app/app/mongoid/admin.rb +22 -1
- data/test/rails_app/app/mongoid/user.rb +35 -0
- data/test/rails_app/config/initializers/devise.rb +6 -7
- data/test/rails_app/config/routes.rb +3 -5
- data/test/rails_app/db/migrate/20100401102949_create_tables.rb +58 -12
- data/test/rails_app/lib/shared_admin.rb +6 -2
- data/test/rails_app/log/development.log +13 -0
- data/test/rails_app/log/test.log +319550 -0
- data/test/routes_test.rb +4 -0
- data/test/support/assertions.rb +4 -1
- data/test/support/helpers.rb +0 -17
- data/test/support/integration.rb +3 -1
- data/test/test_helpers_test.rb +2 -2
- data/test/tmp/app/views/devise/_links.erb +25 -0
- data/test/tmp/app/views/devise/confirmations/new.html.erb +15 -0
- data/test/tmp/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/test/tmp/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/test/tmp/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/test/tmp/app/views/devise/passwords/edit.html.erb +19 -0
- data/test/tmp/app/views/devise/passwords/new.html.erb +15 -0
- data/test/tmp/app/views/devise/registrations/edit.html.erb +22 -0
- data/test/tmp/app/views/devise/registrations/new.html.erb +17 -0
- data/test/tmp/app/views/devise/sessions/new.html.erb +15 -0
- data/test/tmp/app/views/devise/unlocks/new.html.erb +15 -0
- data/test/tmp/app/views/users/_links.erb +25 -0
- data/test/tmp/app/views/users/confirmations/new.html.erb +15 -0
- data/test/tmp/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
- data/test/tmp/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
- data/test/tmp/app/views/users/mailer/unlock_instructions.html.erb +7 -0
- data/test/tmp/app/views/users/passwords/edit.html.erb +19 -0
- data/test/tmp/app/views/users/passwords/new.html.erb +15 -0
- data/test/tmp/app/views/users/registrations/edit.html.erb +22 -0
- data/test/tmp/app/views/users/registrations/new.html.erb +17 -0
- data/test/tmp/app/views/users/sessions/new.html.erb +15 -0
- data/test/tmp/app/views/users/unlocks/new.html.erb +15 -0
- metadata +83 -27
- data/.gitignore +0 -12
- data/.travis.yml +0 -13
- data/Gemfile +0 -35
- data/Rakefile +0 -34
- data/devise.gemspec +0 -25
- data/lib/devise/controllers/internal_helpers.rb +0 -154
- data/lib/devise/controllers/shared_helpers.rb +0 -26
- data/test/schema_test.rb +0 -33
data/CHANGELOG.rdoc
CHANGED
|
@@ -1,8 +1,42 @@
|
|
|
1
|
+
== 2.0.0
|
|
2
|
+
|
|
3
|
+
Notes: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0
|
|
4
|
+
|
|
5
|
+
* enhancements
|
|
6
|
+
* Add support for e-mail reconfirmation on change (by @Mandaryn and @heimidal)
|
|
7
|
+
* Redirect users to sign in page after unlock (by @nashby)
|
|
8
|
+
* Redirect to the previous URL on timeout
|
|
9
|
+
* Inherit from the same Devise parent controller (by @sj26)
|
|
10
|
+
* Allow parent_controller to be customizable via Devise.parent_controller, useful for engines
|
|
11
|
+
* Allow router_name to be customizable via Devise.router_name, useful for engines
|
|
12
|
+
* Allow alternate ORMs to run compatibility setup code before Authenticatable is included (by @jm81)
|
|
13
|
+
|
|
14
|
+
* deprecation
|
|
15
|
+
* Devise now only supports Rails 3.1 forward
|
|
16
|
+
* Devise.confirm_within was deprecated in favor Devise.allow_unconfirmed_access_for
|
|
17
|
+
* Devise.stateless_token= is deprecated in favor of appending :token_auth to Devise.skip_session_storage
|
|
18
|
+
* Usage of Devise.apply_schema is deprecated
|
|
19
|
+
* Usage of Devise migration helpers are deprecated
|
|
20
|
+
* Usage of Devise.remember_across_browsers was deprecated
|
|
21
|
+
* Usage of rememberable with remember_token was removed
|
|
22
|
+
* Usage of recoverable without reset_password_sent_at was removed
|
|
23
|
+
* Usage of Devise.case_insensitive_keys equals to false was removed
|
|
24
|
+
* Move devise/shared/_links.erb to devise/_links.erb
|
|
25
|
+
* Deprecated support of nested devise_for blocks
|
|
26
|
+
* Deprecated support to devise.registrations.reasons and devise.registrations.inactive_signed_up in favor of devise.registrations.signed_up_but_*
|
|
27
|
+
|
|
28
|
+
== 1.5.3
|
|
29
|
+
|
|
30
|
+
* bug fix
|
|
31
|
+
* Ensure delegator converts scope to symbol (by @dmitriy-kiriyenko)
|
|
32
|
+
* Ensure passing :format => false to devise_for is not permanent
|
|
33
|
+
* Ensure path checker does not check invalid routes
|
|
34
|
+
|
|
1
35
|
== 1.5.2
|
|
2
36
|
|
|
3
37
|
* enhancements
|
|
4
|
-
* Add support for
|
|
5
|
-
* Add timeout_in method to Timeoutable, it can be
|
|
38
|
+
* Add support for Rails 3.1 new mass assignment conventions (by @kirs)
|
|
39
|
+
* Add timeout_in method to Timeoutable, it can be overridden in a model (by @lest)
|
|
6
40
|
|
|
7
41
|
* bug fix
|
|
8
42
|
* OmniAuth error message now shows the proper option (:strategy_class instead of :klass)
|
|
@@ -17,10 +51,10 @@
|
|
|
17
51
|
* enhancements
|
|
18
52
|
* Timeoutable also skips tracking if skip_trackable is given
|
|
19
53
|
* devise_for now accepts :failure_app as an option
|
|
20
|
-
* Models can select the proper mailer via devise_mailer method (by
|
|
21
|
-
* Migration generator now uses the change method (by
|
|
22
|
-
* Support to markerb templates on the mailer generator (by
|
|
23
|
-
* Support for Omniauth 1.0 (older versions are no longer supported) (by
|
|
54
|
+
* Models can select the proper mailer via devise_mailer method (by @locomotivecms)
|
|
55
|
+
* Migration generator now uses the change method (by @nashby)
|
|
56
|
+
* Support to markerb templates on the mailer generator (by @sbounmy)
|
|
57
|
+
* Support for Omniauth 1.0 (older versions are no longer supported) (by @TamiasSibiricus)
|
|
24
58
|
|
|
25
59
|
* bug fix
|
|
26
60
|
* Allow idempotent API requests
|
|
@@ -63,7 +97,7 @@
|
|
|
63
97
|
|
|
64
98
|
* bug fix
|
|
65
99
|
* Failure app tries the root path if a session one does not exist
|
|
66
|
-
* No need to finalize Devise helpers all the time (by
|
|
100
|
+
* No need to finalize Devise helpers all the time (by @bradleypriest)
|
|
67
101
|
* Reset password shows proper message if user is not active
|
|
68
102
|
* `clean_up_passwords` sets the accessors to nil to skip validations
|
|
69
103
|
|
|
@@ -98,7 +132,7 @@
|
|
|
98
132
|
* enhancements
|
|
99
133
|
* Add :defaults and :format support on router
|
|
100
134
|
* Add simple form generators
|
|
101
|
-
* Better localization for devise_error_messages! (by
|
|
135
|
+
* Better localization for devise_error_messages! (by @zedtux)
|
|
102
136
|
|
|
103
137
|
* bug fix
|
|
104
138
|
* Ensure to_xml is properly white listened
|
|
@@ -107,20 +141,20 @@
|
|
|
107
141
|
== 1.4.0
|
|
108
142
|
|
|
109
143
|
* enhancements
|
|
110
|
-
* Added authenticated and unauthenticated to the router to route the used based on his status (by
|
|
111
|
-
* Improve e-mail regexp (by
|
|
112
|
-
* Add strip_whitespace_keys and default to e-mail (by
|
|
113
|
-
* Do not run format and uniqueness validations on e-mail if it hasn't changed (by
|
|
114
|
-
* Added update_without_password to update models but not allowing the password to change (by
|
|
115
|
-
* Added config.paranoid, check the generator for more information (by
|
|
144
|
+
* Added authenticated and unauthenticated to the router to route the used based on his status (by @sj26)
|
|
145
|
+
* Improve e-mail regexp (by @rodrigoflores)
|
|
146
|
+
* Add strip_whitespace_keys and default to e-mail (by @swrobel)
|
|
147
|
+
* Do not run format and uniqueness validations on e-mail if it hasn't changed (by @Thibaut)
|
|
148
|
+
* Added update_without_password to update models but not allowing the password to change (by @fschwahn)
|
|
149
|
+
* Added config.paranoid, check the generator for more information (by @rodrigoflores)
|
|
116
150
|
|
|
117
151
|
* bug fix
|
|
118
152
|
* password_required? should not affect length validation
|
|
119
153
|
* User cannot access sign up and similar pages if he is already signed in through a cookie or token
|
|
120
|
-
* Do not convert booleans to strings on finders (by
|
|
121
|
-
* Run validations even if current_password fails (by
|
|
122
|
-
* Devise now honors routes constraints (by
|
|
123
|
-
* Do not return the user resource when requesting instructions (by
|
|
154
|
+
* Do not convert booleans to strings on finders (by @xavier)
|
|
155
|
+
* Run validations even if current_password fails (by @crx)
|
|
156
|
+
* Devise now honors routes constraints (by @macmartine)
|
|
157
|
+
* Do not return the user resource when requesting instructions (by @rodrigoflores)
|
|
124
158
|
|
|
125
159
|
== 1.3.4
|
|
126
160
|
|
|
@@ -135,31 +169,31 @@
|
|
|
135
169
|
== 1.3.2
|
|
136
170
|
|
|
137
171
|
* bug fix
|
|
138
|
-
* Fix another regression related to reset_password_sent_at (by
|
|
172
|
+
* Fix another regression related to reset_password_sent_at (by @alexdreher)
|
|
139
173
|
|
|
140
174
|
== 1.3.1
|
|
141
175
|
|
|
142
176
|
* enhancements
|
|
143
|
-
* Improve failure_app responses (by
|
|
177
|
+
* Improve failure_app responses (by @indirect)
|
|
144
178
|
* sessions/new and registrations/new also respond to xml and json now
|
|
145
179
|
|
|
146
180
|
* bug fix
|
|
147
|
-
* Fix a regression that occurred if reset_password_sent_at is not present (by
|
|
181
|
+
* Fix a regression that occurred if reset_password_sent_at is not present (by @stevehodgkiss)
|
|
148
182
|
|
|
149
183
|
== 1.3.0
|
|
150
184
|
|
|
151
185
|
* enhancements
|
|
152
|
-
* All controllers can now handle different mime types than html using Responders (by
|
|
153
|
-
* Added reset_password_within as configuration option to send the token for recovery (by
|
|
154
|
-
* Bump password length to 128 characters (by
|
|
155
|
-
* Add :only as option to devise_for (by
|
|
156
|
-
* Allow to override path after sending password instructions (by
|
|
157
|
-
* require_no_authentication has its own flash message (by
|
|
186
|
+
* All controllers can now handle different mime types than html using Responders (by @sikachu)
|
|
187
|
+
* Added reset_password_within as configuration option to send the token for recovery (by @jdguyot)
|
|
188
|
+
* Bump password length to 128 characters (by @k33l0r)
|
|
189
|
+
* Add :only as option to devise_for (by @timoschilling)
|
|
190
|
+
* Allow to override path after sending password instructions (by @irohiroki)
|
|
191
|
+
* require_no_authentication has its own flash message (by @jackdempsey)
|
|
158
192
|
|
|
159
193
|
* bug fix
|
|
160
194
|
* Fix a bug where configuration options were being included too late
|
|
161
|
-
* Ensure Devise::TestHelpers can be used to tests Devise internal controllers (by
|
|
162
|
-
* valid_password? should not choke on empty passwords (by
|
|
195
|
+
* Ensure Devise::TestHelpers can be used to tests Devise internal controllers (by @jwilger)
|
|
196
|
+
* valid_password? should not choke on empty passwords (by @mikel)
|
|
163
197
|
* Calling devise more than once does not include previously added modules anymore
|
|
164
198
|
* downcase_keys before validation
|
|
165
199
|
|
|
@@ -186,16 +220,16 @@
|
|
|
186
220
|
|
|
187
221
|
* bug fix
|
|
188
222
|
* Fix an issue causing infinite redirects in production
|
|
189
|
-
* rails g destroy works properly with devise generators (by
|
|
190
|
-
* before_failure callbacks should work on test helpers (by
|
|
191
|
-
* rememberable cookie now is httponly by default (by
|
|
192
|
-
* Add missing confirmation_keys (by
|
|
223
|
+
* rails g destroy works properly with devise generators (by @andmej)
|
|
224
|
+
* before_failure callbacks should work on test helpers (by @twinge)
|
|
225
|
+
* rememberable cookie now is httponly by default (by @JamesFerguson)
|
|
226
|
+
* Add missing confirmation_keys (by @JohnPlummer)
|
|
193
227
|
* Ensure after_* hooks are called on RegistrationsController
|
|
194
228
|
* When using database_authenticatable Devise will now only create an email field when appropriate (if using default authentication_keys or custom authentication_keys with email included)
|
|
195
|
-
* Ensure stateless token does not trigger timeout (by
|
|
229
|
+
* Ensure stateless token does not trigger timeout (by @pixelauthority)
|
|
196
230
|
* Implement handle_unverified_request for Rails 3.0.4 compatibility and improve FailureApp reliance on symbols
|
|
197
231
|
* Consider namespaces while generating routes
|
|
198
|
-
* Custom failure apps no longer ignored in test mode (by
|
|
232
|
+
* Custom failure apps no longer ignored in test mode (by @jaghion)
|
|
199
233
|
* Do not depend on ActiveModel::Dirty
|
|
200
234
|
* Manual sign_in now triggers remember token
|
|
201
235
|
* Be sure to halt strategies on failures
|
|
@@ -204,7 +238,7 @@
|
|
|
204
238
|
* Ensure there is no Mongoid injection
|
|
205
239
|
|
|
206
240
|
* deprecations
|
|
207
|
-
* Deprecated anybody_signed_in? in favor of signed_in? (by
|
|
241
|
+
* Deprecated anybody_signed_in? in favor of signed_in? (by @gavinhughes)
|
|
208
242
|
* Removed --haml and --slim view templates
|
|
209
243
|
* Devise::OmniAuth helpers were deprecated and removed in favor of Omniauth.config.test_mode
|
|
210
244
|
|
|
@@ -217,11 +251,11 @@
|
|
|
217
251
|
* enhancements
|
|
218
252
|
* Added OmniAuth support
|
|
219
253
|
* Added ORM adapter to abstract ORM iteraction
|
|
220
|
-
* sign_out_via is available in the router to configure the method used for sign out (by
|
|
221
|
-
* Improved Ajax requests handling in failure app (by
|
|
254
|
+
* sign_out_via is available in the router to configure the method used for sign out (by @martinrehfeld)
|
|
255
|
+
* Improved Ajax requests handling in failure app (by @spastorino)
|
|
222
256
|
* Added request_keys to easily use request specific values (like subdomain) in authentication
|
|
223
257
|
* Increased the size of friendly_token to 60 characters (reduces the chances of a successful brute attack)
|
|
224
|
-
* Ensure the friendly token does not include "_" or "-" since some e-mails may not autolink it properly (by
|
|
258
|
+
* Ensure the friendly token does not include "_" or "-" since some e-mails may not autolink it properly (by @rymai)
|
|
225
259
|
* Extracted encryptors into :encryptable for better bcrypt support
|
|
226
260
|
* :rememberable is now able to use salt as token if no remember_token is provided
|
|
227
261
|
* Store the salt in session and expire the session if the user changes his password
|
|
@@ -230,7 +264,7 @@
|
|
|
230
264
|
* Sign up now check if the user is active or not and redirect him accordingly setting the inactive_signed_up message
|
|
231
265
|
* Use ActiveModel#to_key instead of #id
|
|
232
266
|
* sign_out_all_scopes now destroys the whole session
|
|
233
|
-
* Added case_insensitive_keys that automatically downcases the given keys, by default downcases only e-mail (by
|
|
267
|
+
* Added case_insensitive_keys that automatically downcases the given keys, by default downcases only e-mail (by @adahl)
|
|
234
268
|
|
|
235
269
|
* default behavior changes
|
|
236
270
|
* sign_out_all_scopes defaults to true as security measure
|
|
@@ -239,12 +273,12 @@
|
|
|
239
273
|
|
|
240
274
|
* bugfix
|
|
241
275
|
* after_sign_in_path_for always receives a resource
|
|
242
|
-
* Do not execute Warden::Callbacks on Devise::TestHelpers (by
|
|
243
|
-
* Allow password recovery and account unlocking to change used keys (by
|
|
276
|
+
* Do not execute Warden::Callbacks on Devise::TestHelpers (by @sgronblo)
|
|
277
|
+
* Allow password recovery and account unlocking to change used keys (by @RStankov)
|
|
244
278
|
* FailureApp now properly handles nil request.format
|
|
245
279
|
* Fix a bug causing FailureApp to return with HTTP Auth Headers for IE7
|
|
246
280
|
* Ensure namespaces has proper scoped views
|
|
247
|
-
* Ensure Devise does not set empty flash messages (by
|
|
281
|
+
* Ensure Devise does not set empty flash messages (by @sxross)
|
|
248
282
|
|
|
249
283
|
== 1.1.6
|
|
250
284
|
|
|
@@ -269,11 +303,11 @@
|
|
|
269
303
|
|
|
270
304
|
* bugfix
|
|
271
305
|
* Add reply-to to e-mail headers by default
|
|
272
|
-
* Updated the views generator to respect the rails :template_engine option (by
|
|
306
|
+
* Updated the views generator to respect the rails :template_engine option (by @fredwu)
|
|
273
307
|
* Check the type of HTTP Authentication before using Basic headers
|
|
274
|
-
* Avoid invalid_salt errors by checking salt presence (by
|
|
275
|
-
* Forget user deletes the right cookie before logout, not remembering the user anymore (by
|
|
276
|
-
* Fix for failed first-ever logins on PostgreSQL where column default is nil (by
|
|
308
|
+
* Avoid invalid_salt errors by checking salt presence (by @thibaudgg)
|
|
309
|
+
* Forget user deletes the right cookie before logout, not remembering the user anymore (by @emtrane)
|
|
310
|
+
* Fix for failed first-ever logins on PostgreSQL where column default is nil (by @bensie)
|
|
277
311
|
* :default options is now honored in migrations
|
|
278
312
|
|
|
279
313
|
== 1.1.2
|
|
@@ -289,16 +323,16 @@
|
|
|
289
323
|
== 1.1.0
|
|
290
324
|
|
|
291
325
|
* enhancements
|
|
292
|
-
* Rememberable module allows user to be remembered across browsers and is enabled by default (by
|
|
293
|
-
* Rememberable module allows you to activate the period the remember me token is extended (by
|
|
326
|
+
* Rememberable module allows user to be remembered across browsers and is enabled by default (by @trevorturk)
|
|
327
|
+
* Rememberable module allows you to activate the period the remember me token is extended (by @trevorturk)
|
|
294
328
|
* devise_for can now be used together with scope method in routes but with a few limitations (check the documentation)
|
|
295
329
|
* Support `as` or `devise_scope` in the router to specify controller access scope
|
|
296
|
-
* HTTP Basic Auth can now be disabled/enabled for xhr(ajax) requests using http_authenticatable_on_xhr option (by
|
|
330
|
+
* HTTP Basic Auth can now be disabled/enabled for xhr(ajax) requests using http_authenticatable_on_xhr option (by @pellja)
|
|
297
331
|
|
|
298
332
|
* bug fix
|
|
299
333
|
* Fix a bug in Devise::TestHelpers where current_user was returning a Response object for non active accounts
|
|
300
334
|
* Devise should respect script_name and path_info contracts
|
|
301
|
-
* Fix a bug when accessing a path with (.:format) (by
|
|
335
|
+
* Fix a bug when accessing a path with (.:format) (by @klacointe)
|
|
302
336
|
* Do not add unlock routes unless unlock strategy is email or both
|
|
303
337
|
* Email should be case insensitive
|
|
304
338
|
* Store classes as string in session, to avoid serialization and stale data issues
|
|
@@ -309,10 +343,10 @@
|
|
|
309
343
|
== 1.1.rc2
|
|
310
344
|
|
|
311
345
|
* enhancements
|
|
312
|
-
* Allow to set cookie domain for the remember token. (by
|
|
346
|
+
* Allow to set cookie domain for the remember token. (by @mantas)
|
|
313
347
|
* Added navigational formats to specify when it should return a 302 and when a 401.
|
|
314
|
-
* Added authenticate(scope) support in routes (by
|
|
315
|
-
* Added after_update_path_for to registrations controller (by
|
|
348
|
+
* Added authenticate(scope) support in routes (by @wildchild)
|
|
349
|
+
* Added after_update_path_for to registrations controller (by @thedelchop)
|
|
316
350
|
* Allow the mailer object to be replaced through config.mailer = "MyOwnMailer"
|
|
317
351
|
|
|
318
352
|
* bug fix
|
|
@@ -360,10 +394,10 @@
|
|
|
360
394
|
|
|
361
395
|
* enhancements
|
|
362
396
|
* Support for latest MongoMapper
|
|
363
|
-
* Added anybody_signed_in? helper (by
|
|
397
|
+
* Added anybody_signed_in? helper (by @SSDany)
|
|
364
398
|
|
|
365
399
|
* bug fix
|
|
366
|
-
* confirmation_required? is properly honored on active? calls. (by
|
|
400
|
+
* confirmation_required? is properly honored on active? calls. (by @paulrosania)
|
|
367
401
|
|
|
368
402
|
== 1.0.7
|
|
369
403
|
|
|
@@ -404,7 +438,7 @@
|
|
|
404
438
|
== 1.0.2
|
|
405
439
|
|
|
406
440
|
* enhancements
|
|
407
|
-
* Allows you set mailer content type (by
|
|
441
|
+
* Allows you set mailer content type (by @glennr)
|
|
408
442
|
|
|
409
443
|
* bug fix
|
|
410
444
|
* Uses the same content type as request on http authenticatable 401 responses
|
|
@@ -437,12 +471,12 @@
|
|
|
437
471
|
|
|
438
472
|
* enhancements
|
|
439
473
|
* Added gemspec to repo
|
|
440
|
-
* Added token authenticatable (by
|
|
474
|
+
* Added token authenticatable (by @grimen)
|
|
441
475
|
|
|
442
476
|
== 0.9.1
|
|
443
477
|
|
|
444
478
|
* bug fix
|
|
445
|
-
* Allow bigger salt size (by
|
|
479
|
+
* Allow bigger salt size (by @jgeiger)
|
|
446
480
|
* Fix relative url root
|
|
447
481
|
|
|
448
482
|
== 0.9.0
|
|
@@ -452,11 +486,11 @@
|
|
|
452
486
|
* :success and :failure flash messages are now :notice and :alert
|
|
453
487
|
|
|
454
488
|
* enhancements
|
|
455
|
-
* Added devise lockable (by
|
|
489
|
+
* Added devise lockable (by @mhfs)
|
|
456
490
|
* Warden 0.9.0 compatibility
|
|
457
491
|
* Mongomapper 0.6.10 compatibility
|
|
458
|
-
* Added Devise.add_module as hooks for extensions (by
|
|
459
|
-
* Ruby 1.9.1 compatibility (by
|
|
492
|
+
* Added Devise.add_module as hooks for extensions (by @grimen)
|
|
493
|
+
* Ruby 1.9.1 compatibility (by @grimen)
|
|
460
494
|
|
|
461
495
|
* bug fix
|
|
462
496
|
* Accept path prefix not starting with slash
|
|
@@ -465,10 +499,10 @@
|
|
|
465
499
|
== 0.8.2
|
|
466
500
|
|
|
467
501
|
* enhancements
|
|
468
|
-
* Allow Devise.mailer_sender to be a proc (by
|
|
502
|
+
* Allow Devise.mailer_sender to be a proc (by @grimen)
|
|
469
503
|
|
|
470
504
|
* bug fix
|
|
471
|
-
* Fix bug with passenger, update is required to anyone deploying on passenger (by
|
|
505
|
+
* Fix bug with passenger, update is required to anyone deploying on passenger (by @dvdpalm)
|
|
472
506
|
|
|
473
507
|
== 0.8.1
|
|
474
508
|
|
|
@@ -485,11 +519,11 @@
|
|
|
485
519
|
* enhancements
|
|
486
520
|
* Warden 0.8.0 compatibility
|
|
487
521
|
* Add an easy for map.connect "sign_in", :controller => "sessions", :action => "new" to work
|
|
488
|
-
* Added :bcrypt encryptor (by
|
|
522
|
+
* Added :bcrypt encryptor (by @capotej)
|
|
489
523
|
|
|
490
524
|
* bug fix
|
|
491
525
|
* sign_in_count is also increased when user signs in via password change, confirmation, etc..
|
|
492
|
-
* More DataMapper compatibility (by
|
|
526
|
+
* More DataMapper compatibility (by @lancecarlson)
|
|
493
527
|
|
|
494
528
|
* deprecation
|
|
495
529
|
* Removed DeviseMailer.sender
|
|
@@ -529,7 +563,7 @@
|
|
|
529
563
|
== 0.7.1
|
|
530
564
|
|
|
531
565
|
* enhancements
|
|
532
|
-
* Small enhancements for other plugins compatibility (by
|
|
566
|
+
* Small enhancements for other plugins compatibility (by @grimen)
|
|
533
567
|
|
|
534
568
|
== 0.7.0
|
|
535
569
|
|
|
@@ -623,9 +657,9 @@
|
|
|
623
657
|
* Fixed a bug where remember me module was not working properly
|
|
624
658
|
|
|
625
659
|
* enhancements
|
|
626
|
-
* Moved encryption strategy into the Encryptors module to allow several algorithms (by
|
|
627
|
-
* Implemented encryptors for Clearance, Authlogic and Restful-Authentication (by
|
|
628
|
-
* Added support for MongoMapper (by
|
|
660
|
+
* Moved encryption strategy into the Encryptors module to allow several algorithms (by @mhfs)
|
|
661
|
+
* Implemented encryptors for Clearance, Authlogic and Restful-Authentication (by @mhfs)
|
|
662
|
+
* Added support for MongoMapper (by @shingara)
|
|
629
663
|
|
|
630
664
|
== 0.4.3
|
|
631
665
|
|
data/MIT-LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright 2009-
|
|
1
|
+
Copyright 2009-2012 Plataforma Tecnologia. http://blog.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.rdoc
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
*IMPORTANT:* Devise 2.0.0 is out. If you are upgrading, please read: https://github.com/plataformatec/devise/wiki/How-To:-Upgrade-to-Devise-2.0
|
|
2
|
+
|
|
1
3
|
== Devise
|
|
2
4
|
|
|
3
5
|
{<img src="https://secure.travis-ci.org/plataformatec/devise.png" />}[http://travis-ci.org/plataformatec/devise]
|
|
@@ -210,7 +212,7 @@ Devise allows you to set up as many roles as you want. For example, you may have
|
|
|
210
212
|
|
|
211
213
|
We built Devise to help you quickly develop an application that uses authentication. However, we don't want to be in your way when you need to customize it.
|
|
212
214
|
|
|
213
|
-
Since Devise is an engine, all its views are packaged inside the gem. These views will help you get started, but after
|
|
215
|
+
Since Devise is an engine, all its views are packaged inside the gem. These views will help you get started, but after some time you may want to change them. If this is the case, you just need to invoke the following generator, and it will copy all views to your application:
|
|
214
216
|
|
|
215
217
|
rails generate devise:views
|
|
216
218
|
|
|
@@ -363,4 +365,4 @@ https://github.com/plataformatec/devise/contributors
|
|
|
363
365
|
|
|
364
366
|
== License
|
|
365
367
|
|
|
366
|
-
MIT License. Copyright
|
|
368
|
+
MIT License. Copyright 2012 Plataforma Tecnologia. http://blog.plataformatec.com.br
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
class Devise::ConfirmationsController <
|
|
2
|
-
include Devise::Controllers::InternalHelpers
|
|
3
|
-
|
|
1
|
+
class Devise::ConfirmationsController < DeviseController
|
|
4
2
|
# GET /resource/confirmation/new
|
|
5
3
|
def new
|
|
6
4
|
build_resource({})
|
|
7
|
-
render_with_scope :new
|
|
8
5
|
end
|
|
9
6
|
|
|
10
7
|
# POST /resource/confirmation
|
|
@@ -14,7 +11,7 @@ class Devise::ConfirmationsController < ApplicationController
|
|
|
14
11
|
if successfully_sent?(resource)
|
|
15
12
|
respond_with({}, :location => after_resending_confirmation_instructions_path_for(resource_name))
|
|
16
13
|
else
|
|
17
|
-
|
|
14
|
+
respond_with(resource)
|
|
18
15
|
end
|
|
19
16
|
end
|
|
20
17
|
|
|
@@ -27,7 +24,7 @@ class Devise::ConfirmationsController < ApplicationController
|
|
|
27
24
|
sign_in(resource_name, resource)
|
|
28
25
|
respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
|
|
29
26
|
else
|
|
30
|
-
respond_with_navigational(resource.errors, :status => :unprocessable_entity){
|
|
27
|
+
respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render :new }
|
|
31
28
|
end
|
|
32
29
|
end
|
|
33
30
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
class Devise::OmniauthCallbacksController <
|
|
2
|
-
include Devise::Controllers::InternalHelpers
|
|
3
|
-
|
|
1
|
+
class Devise::OmniauthCallbacksController < DeviseController
|
|
4
2
|
def failure
|
|
5
3
|
set_flash_message :alert, :failure, :kind => failed_strategy.name.to_s.humanize, :reason => failure_message
|
|
6
4
|
redirect_to after_omniauth_failure_path_for(resource_name)
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
class Devise::PasswordsController <
|
|
1
|
+
class Devise::PasswordsController < DeviseController
|
|
2
2
|
prepend_before_filter :require_no_authentication
|
|
3
|
-
include Devise::Controllers::InternalHelpers
|
|
4
3
|
|
|
5
4
|
# GET /resource/password/new
|
|
6
5
|
def new
|
|
7
6
|
build_resource({})
|
|
8
|
-
render_with_scope :new
|
|
9
7
|
end
|
|
10
8
|
|
|
11
9
|
# POST /resource/password
|
|
@@ -15,7 +13,7 @@ class Devise::PasswordsController < ApplicationController
|
|
|
15
13
|
if successfully_sent?(resource)
|
|
16
14
|
respond_with({}, :location => after_sending_reset_password_instructions_path_for(resource_name))
|
|
17
15
|
else
|
|
18
|
-
|
|
16
|
+
respond_with(resource)
|
|
19
17
|
end
|
|
20
18
|
end
|
|
21
19
|
|
|
@@ -23,7 +21,6 @@ class Devise::PasswordsController < ApplicationController
|
|
|
23
21
|
def edit
|
|
24
22
|
self.resource = resource_class.new
|
|
25
23
|
resource.reset_password_token = params[:reset_password_token]
|
|
26
|
-
render_with_scope :edit
|
|
27
24
|
end
|
|
28
25
|
|
|
29
26
|
# PUT /resource/password
|
|
@@ -36,7 +33,7 @@ class Devise::PasswordsController < ApplicationController
|
|
|
36
33
|
sign_in(resource_name, resource)
|
|
37
34
|
respond_with resource, :location => after_sign_in_path_for(resource)
|
|
38
35
|
else
|
|
39
|
-
|
|
36
|
+
respond_with resource
|
|
40
37
|
end
|
|
41
38
|
end
|
|
42
39
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
class Devise::RegistrationsController <
|
|
1
|
+
class Devise::RegistrationsController < DeviseController
|
|
2
2
|
prepend_before_filter :require_no_authentication, :only => [ :new, :create, :cancel ]
|
|
3
3
|
prepend_before_filter :authenticate_scope!, :only => [:edit, :update, :destroy]
|
|
4
|
-
include Devise::Controllers::InternalHelpers
|
|
5
4
|
|
|
6
5
|
# GET /resource/sign_up
|
|
7
6
|
def new
|
|
8
7
|
resource = build_resource({})
|
|
9
|
-
|
|
8
|
+
respond_with resource
|
|
10
9
|
end
|
|
11
10
|
|
|
12
11
|
# POST /resource
|
|
@@ -19,19 +18,19 @@ class Devise::RegistrationsController < ApplicationController
|
|
|
19
18
|
sign_in(resource_name, resource)
|
|
20
19
|
respond_with resource, :location => after_sign_up_path_for(resource)
|
|
21
20
|
else
|
|
22
|
-
set_flash_message :notice, :
|
|
21
|
+
set_flash_message :notice, :"signed_up_but_#{resource.inactive_message}" if is_navigational_format?
|
|
23
22
|
expire_session_data_after_sign_in!
|
|
24
23
|
respond_with resource, :location => after_inactive_sign_up_path_for(resource)
|
|
25
24
|
end
|
|
26
25
|
else
|
|
27
|
-
clean_up_passwords
|
|
28
|
-
|
|
26
|
+
clean_up_passwords resource
|
|
27
|
+
respond_with resource
|
|
29
28
|
end
|
|
30
29
|
end
|
|
31
30
|
|
|
32
31
|
# GET /resource/edit
|
|
33
32
|
def edit
|
|
34
|
-
|
|
33
|
+
render :edit
|
|
35
34
|
end
|
|
36
35
|
|
|
37
36
|
# PUT /resource
|
|
@@ -41,12 +40,17 @@ class Devise::RegistrationsController < ApplicationController
|
|
|
41
40
|
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
|
|
42
41
|
|
|
43
42
|
if resource.update_with_password(params[resource_name])
|
|
44
|
-
|
|
43
|
+
if is_navigational_format?
|
|
44
|
+
if resource.respond_to?(:pending_reconfirmation?) && resource.pending_reconfirmation?
|
|
45
|
+
flash_key = :update_needs_confirmation
|
|
46
|
+
end
|
|
47
|
+
set_flash_message :notice, flash_key || :updated
|
|
48
|
+
end
|
|
45
49
|
sign_in resource_name, resource, :bypass => true
|
|
46
50
|
respond_with resource, :location => after_update_path_for(resource)
|
|
47
51
|
else
|
|
48
|
-
clean_up_passwords
|
|
49
|
-
|
|
52
|
+
clean_up_passwords resource
|
|
53
|
+
respond_with resource
|
|
50
54
|
end
|
|
51
55
|
end
|
|
52
56
|
|
|
@@ -70,40 +74,34 @@ class Devise::RegistrationsController < ApplicationController
|
|
|
70
74
|
|
|
71
75
|
protected
|
|
72
76
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
# The path used after sign up. You need to overwrite this method
|
|
81
|
-
# in your own RegistrationsController.
|
|
82
|
-
def after_sign_up_path_for(resource)
|
|
83
|
-
after_sign_in_path_for(resource)
|
|
84
|
-
end
|
|
77
|
+
# Build a devise resource passing in the session. Useful to move
|
|
78
|
+
# temporary session data to the newly created user.
|
|
79
|
+
def build_resource(hash=nil)
|
|
80
|
+
hash ||= params[resource_name] || {}
|
|
81
|
+
self.resource = resource_class.new_with_session(hash, session)
|
|
82
|
+
end
|
|
85
83
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
# The path used after sign up. You need to overwrite this method
|
|
85
|
+
# in your own RegistrationsController.
|
|
86
|
+
def after_sign_up_path_for(resource)
|
|
87
|
+
after_sign_in_path_for(resource)
|
|
88
|
+
end
|
|
91
89
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
# The path used after sign up for inactive accounts. You need to overwrite
|
|
91
|
+
# this method in your own RegistrationsController.
|
|
92
|
+
def after_inactive_sign_up_path_for(resource)
|
|
93
|
+
respond_to?(:root_path) ? root_path : "/"
|
|
94
|
+
end
|
|
97
95
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
# The default url to be used after updating a resource. You need to overwrite
|
|
97
|
+
# this method in your own RegistrationsController.
|
|
98
|
+
def after_update_path_for(resource)
|
|
99
|
+
signed_in_root_path(resource)
|
|
100
|
+
end
|
|
103
101
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
102
|
+
# Authenticates the current scope and gets the current resource from the session.
|
|
103
|
+
def authenticate_scope!
|
|
104
|
+
send(:"authenticate_#{resource_name}!", :force => true)
|
|
105
|
+
self.resource = send(:"current_#{resource_name}")
|
|
106
|
+
end
|
|
109
107
|
end
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
class Devise::SessionsController <
|
|
1
|
+
class Devise::SessionsController < DeviseController
|
|
2
2
|
prepend_before_filter :require_no_authentication, :only => [ :new, :create ]
|
|
3
3
|
prepend_before_filter :allow_params_authentication!, :only => :create
|
|
4
|
-
include Devise::Controllers::InternalHelpers
|
|
5
4
|
|
|
6
5
|
# GET /resource/sign_in
|
|
7
6
|
def new
|
|
8
7
|
resource = build_resource
|
|
9
8
|
clean_up_passwords(resource)
|
|
10
|
-
|
|
9
|
+
respond_with(resource, stub_options(resource))
|
|
11
10
|
end
|
|
12
11
|
|
|
13
12
|
# POST /resource/sign_in
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
class Devise::UnlocksController <
|
|
1
|
+
class Devise::UnlocksController < DeviseController
|
|
2
2
|
prepend_before_filter :require_no_authentication
|
|
3
|
-
include Devise::Controllers::InternalHelpers
|
|
4
3
|
|
|
5
4
|
# GET /resource/unlock/new
|
|
6
5
|
def new
|
|
7
6
|
build_resource({})
|
|
8
|
-
render_with_scope :new
|
|
9
7
|
end
|
|
10
8
|
|
|
11
9
|
# POST /resource/unlock
|
|
@@ -15,7 +13,7 @@ class Devise::UnlocksController < ApplicationController
|
|
|
15
13
|
if successfully_sent?(resource)
|
|
16
14
|
respond_with({}, :location => new_session_path(resource_name))
|
|
17
15
|
else
|
|
18
|
-
|
|
16
|
+
respond_with(resource)
|
|
19
17
|
end
|
|
20
18
|
end
|
|
21
19
|
|
|
@@ -25,10 +23,9 @@ class Devise::UnlocksController < ApplicationController
|
|
|
25
23
|
|
|
26
24
|
if resource.errors.empty?
|
|
27
25
|
set_flash_message :notice, :unlocked if is_navigational_format?
|
|
28
|
-
|
|
29
|
-
respond_with_navigational(resource){ redirect_to after_sign_in_path_for(resource) }
|
|
26
|
+
respond_with_navigational(resource){ redirect_to new_session_path(resource) }
|
|
30
27
|
else
|
|
31
|
-
respond_with_navigational(resource.errors, :status => :unprocessable_entity){
|
|
28
|
+
respond_with_navigational(resource.errors, :status => :unprocessable_entity){ render :new }
|
|
32
29
|
end
|
|
33
30
|
end
|
|
34
31
|
end
|