1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Do not fill in passwords fields on failure.

This commit is contained in:
José Valim 2009-10-29 08:43:45 -02:00
parent eb4437adaf
commit d3f9e9c2a1

View file

@ -78,9 +78,12 @@ module Devise
instance_variable_set(:"@#{resource_name}", new_resource) instance_variable_set(:"@#{resource_name}", new_resource)
end end
# Build a devise resource # Build a devise resource without setting password and password confirmation fields.
def build_resource def build_resource
self.resource = resource_class.new(params[resource_name]) self.resource ||= begin
attributes = params[resource_name].try(:except, :password, :password_confirmation)
resource_class.new(attributes)
end
end end
# Helper for use in before_filters where no authentication is required. # Helper for use in before_filters where no authentication is required.