Permalink
Browse files

Added debrecation warning to passwords controller

  • Loading branch information...
1 parent 610c8c3 commit d6f50200679f2c23568753faeae9de983eca1a6d @harlow harlow committed Oct 18, 2012
Showing with 12 additions and 1 deletion.
  1. +12 −1 app/controllers/clearance/passwords_controller.rb
@@ -1,3 +1,5 @@
+require 'active_support/deprecation'
+
class Clearance::PasswordsController < ApplicationController
unloadable
@@ -25,7 +27,7 @@ def new
def update
@user = find_user_for_update
- if @user.update_password params[:password_reset][:password]
+ if @user.update_password password_reset_params
sign_in @user
redirect_to url_after_update
else
@@ -36,6 +38,15 @@ def update
private
+ def password_reset_params
+ if params.has_key? :user
+ ActiveSupport::Deprecation.warn %{Since locales functionality was added, accessing params[:user] is no longer supported.}
+ params[:user][:password]
+ else
+ params[:password_reset][:password]
+ end
+ end
+
def find_user_by_id_and_confirmation_token
Clearance.configuration.user_model.
find_by_id_and_confirmation_token params[:user_id], params[:token].to_s

0 comments on commit d6f5020

Please sign in to comment.