lib/janus/controllers/passwords_controller.rb in janus-0.6.0 vs lib/janus/controllers/passwords_controller.rb in janus-0.7.0

- old
+ new

@@ -10,15 +10,15 @@ self.resource = resource_class.new end def create self.resource = resource_class.find_for_database_authentication(params[resource_name]) - + if resource resource.generate_reset_password_token! JanusMailer.reset_password_instructions(resource).deliver - + respond_to do |format| format.html { redirect_to root_url, :notice => t('flash.janus.passwords.create.email_sent') } format.any { head :ok } end else @@ -38,10 +38,10 @@ redirect_to root_url, :alert => t('flash.janus.passwords.edit.alert') unless resource end def update self.resource = resource_class.find_for_password_reset(params[resource_name][:reset_password_token]) - + if resource if resource.reset_password!(params[resource_name]) respond_to do |format| format.html { redirect_to root_url, :notice => t('flash.janus.passwords.update.password_updated') } format.any { head :ok }