mirror of
https://github.com/heartcombo/devise.git
synced 2026-04-28 03:00:29 -04:00
Cleaning up recoverable methods, changing to use a hash of options instead of default parameters.
This commit is contained in:
@@ -5,8 +5,8 @@ class PasswordsController < ApplicationController
|
||||
end
|
||||
|
||||
def create
|
||||
@password = User.find_and_send_reset_password_instructions(params[:password][:email])
|
||||
if !@password.new_record?
|
||||
@password = User.send_reset_password_instructions(params[:password])
|
||||
if @password.errors.empty?
|
||||
flash[:notice] = 'You will receive an email with instructions about how to reset your password in a few minutes.'
|
||||
redirect_to new_session_path
|
||||
else
|
||||
@@ -20,8 +20,7 @@ class PasswordsController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
@password = User.find_and_reset_password(params[:password][:perishable_token],
|
||||
params[:password][:password], params[:password][:password_confirmation])
|
||||
@password = User.reset_password(params[:password])
|
||||
if @password.errors.empty?
|
||||
flash[:notice] = 'Your password was changed successfully.'
|
||||
redirect_to new_session_path
|
||||
|
||||
Reference in New Issue
Block a user