mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Merge pull request #2582 from tod-uma/master
Allowed updating of attributes without a password if password_required? resolves to false.
This commit is contained in:
commit
2d919fba32
1 changed files with 7 additions and 1 deletions
|
@ -40,7 +40,7 @@ class Devise::RegistrationsController < DeviseController
|
||||||
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
|
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
|
||||||
prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)
|
prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)
|
||||||
|
|
||||||
if resource.update_with_password(account_update_params)
|
if update_resource(resource, account_update_params)
|
||||||
if is_navigational_format?
|
if is_navigational_format?
|
||||||
flash_key = update_needs_confirmation?(resource, prev_unconfirmed_email) ?
|
flash_key = update_needs_confirmation?(resource, prev_unconfirmed_email) ?
|
||||||
:update_needs_confirmation : :updated
|
:update_needs_confirmation : :updated
|
||||||
|
@ -80,6 +80,12 @@ class Devise::RegistrationsController < DeviseController
|
||||||
previous != resource.unconfirmed_email
|
previous != resource.unconfirmed_email
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# By default we want to require a password checks on update.
|
||||||
|
# You can overwrite this method in your own RegistrationsController.
|
||||||
|
def update_resource(resource, params)
|
||||||
|
resource.update_with_password(params)
|
||||||
|
end
|
||||||
|
|
||||||
# Build a devise resource passing in the session. Useful to move
|
# Build a devise resource passing in the session. Useful to move
|
||||||
# temporary session data to the newly created user.
|
# temporary session data to the newly created user.
|
||||||
def build_resource(hash=nil)
|
def build_resource(hash=nil)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue