Skip to content

Commit

Permalink
added control on registration fields
Browse files Browse the repository at this point in the history
  • Loading branch information
cdparra committed May 4, 2016
1 parent 140720f commit 1113537
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/api/v0/ballot_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1113537

Please sign in to comment.