lib/rodauth/features/reset_password.rb in rodauth-1.7.0 vs lib/rodauth/features/reset_password.rb in rodauth-1.8.0

- old
+ new

@@ -62,10 +62,11 @@ after_reset_password_request end set_notice_flash reset_password_email_sent_notice_flash else + set_redirect_error_status(no_matching_login_error_status) set_redirect_error_flash reset_password_request_error_flash end redirect reset_password_email_sent_redirect end @@ -93,25 +94,26 @@ end r.post do key = session[reset_password_session_key] || param(reset_password_key_param) unless account_from_reset_password_key(key) + set_redirect_error_status(invalid_key_error_status) set_redirect_error_flash reset_password_error_flash redirect reset_password_email_sent_redirect end password = param(password_param) catch_error do if password_match?(password) - throw_error(password_param, same_as_existing_password_message) + throw_error_status(invalid_field_error_status, password_param, same_as_existing_password_message) end if require_password_confirmation? && password != param(password_confirm_param) - throw_error(password_param, passwords_do_not_match_message) + throw_error_status(unmatched_field_error_status, password_param, passwords_do_not_match_message) end unless password_meets_requirements?(password) - throw_error(password_param, password_does_not_meet_requirements_message) + throw_error_status(invalid_field_error_status, password_param, password_does_not_meet_requirements_message) end transaction do before_reset_password set_password(password)