Ajax for non-logged-in users

I’m working on a plugin that captures some data from a non-logged-in user (such as a Like Button) and enters it into the database based on post_id.

My plugin works fine for logged-in users but non-logged-in users produces a “-1” response in AJAX.

I’m guessing this has to do with an authentication barrier for writing to the database but I’m looking for a way to work around that.

Any ideas?

EDIT: Here is the code: http://pastebin.com/ghtvJNiW
I’m basing this off the Love-It AJAX plugin by Pippin. He says in the tutorial that this only works for logged-in users but I need to get this to work for non-logged-in users as well.

Solutions Collecting From Web of "Ajax for non-logged-in users"