We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b65f108 commit cbd4239Copy full SHA for cbd4239
app/controllers/users/passwords_controller.rb
@@ -5,13 +5,13 @@ class Users::PasswordsController < Devise::PasswordsController
5
6
def create
7
@email = params.dig(resource_name, :email)
8
- @phone_number = params[resource_name][:phone_number]
9
- @resource = @email.blank? ? User.find_by(phone_number: @phone_number) : User.find_by(email: @email)
+ @phone_number = params.dig(resource_name, :phone_number)
10
11
unless valid_params?(@email, @phone_number)
12
render_error
13
return if @errors
14
end
+ @resource = @email.blank? ? User.find_by(phone_number: @phone_number) : User.find_by(email: @email)
15
16
send_password
17
redirect_to after_sending_reset_password_instructions_path_for(resource_name),
0 commit comments