@ -4,7 +4,7 @@ class Auth::PasswordsController < Devise::PasswordsController
def reset_confirmation
self.resource = resource_class.new
@email = params["email"]
if @email.empty?
if @email.blank?
resource.errors.add :email, I18n.t("validations.email.blank")
render "devise/passwords/new", status: :unprocessable_entity
elsif !email_valid?(@email)
@ -145,4 +145,12 @@ RSpec.describe Auth::PasswordsController, type: :request do
end
context "when a password is reset" do
let(:email) { nil }
it "does not error if the email is nil or not in the params" do
expect { get account_password_reset_confirmation_path(email:) }.not_to raise_error