Skip to content

Commit

Permalink
bring find_user_from_password_reset closer to the callback
Browse files Browse the repository at this point in the history
  • Loading branch information
mxie committed Feb 12, 2015
1 parent ea52aac commit 832f668
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/controllers/clearance/passwords_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ def password_reset_params
end
end

def find_user_from_password_reset
if matching_password_reset = find_password_reset_by_user_id_and_token
matching_password_reset.user
end
end

def find_password_reset_by_user_id_and_token
PasswordReset.find_by_user_id_and_token(
params[user_param],
Expand Down Expand Up @@ -113,6 +107,12 @@ def forbid_non_existent_user
end
end

def find_user_from_password_reset
if matching_password_reset = find_password_reset_by_user_id_and_token
matching_password_reset.user
end
end

def forbid_expired_password_reset
matched_password_reset = find_password_reset_by_user_id_and_token

Expand Down

0 comments on commit 832f668

Please sign in to comment.