Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added better logging for password resets

  • Loading branch information...
commit 4a8d79b04207aed86fe5cb43f0f4023b0fe5332e 1 parent 995bdd2
@bbuchalter bbuchalter authored
View
7 plugins/trisano_auth/app/controllers/password_resets_controller.rb
@@ -31,7 +31,8 @@ def edit
def update
@user.password = params[:user][:password]
@user.password_confirmation = params[:user][:password_confirmation]
- if @user.save
+ if @user.save
+ Rails.logger.info "Reset password for #{@user.inspect}"
@user.reset_perishable_token! # invalidate used token
flash[:notice] = "Password successfully updated"
redirect_to home_url
@@ -57,7 +58,9 @@ def load_user_using_perishable_token
# Will check token is found and that user's updated at field
# is within the time specified by config_options[:trisano_auth][:password_reset_timeout].minutes
@user = User.find_using_perishable_token(params[:id])
-
+
+ Rails.logger.info "Granted #{@user.inspect} access via perishable token."
+
unless @user
flash[:notice] = "We're sorry, but we could not locate your account. " +
"If you are having issues try copying and pasting the URL " +
Please sign in to comment.
Something went wrong with that request. Please try again.