diff --git a/app/controllers/api/v0/ballot_controller.rb b/app/controllers/api/v0/ballot_controller.rb index 71c1740..3b78dd5 100644 --- a/app/controllers/api/v0/ballot_controller.rb +++ b/app/controllers/api/v0/ballot_controller.rb @@ -228,6 +228,11 @@ def registration render :json => {:error => "User input does not match the expected type"}, :status => 400 and return end end + + # if matching field expected value is not null, compare it to the user input + if matching_field[:expected_value] != nil && matching_field[:expected_value] != user_input + render :json => {:error => "User input does not match the expected value on "+matching_field[:name]}, :status => 400 and return + end end # Create a signature from the registration fields.