Skip to content

Instantly share code, notes, and snippets.

@brendensoares
Created January 31, 2012 21:56
Show Gist options
  • Save brendensoares/1713236 to your computer and use it in GitHub Desktop.
Save brendensoares/1713236 to your computer and use it in GitHub Desktop.
CSRF callback debug
// Validate the request
Security::protect_from_forgery($this->request, function($success) {
if ( ! $success)
{
$this->response->status(403);
echo json_encode(array('message' => 'Your requested changes were invalid. Please try again.'));
exit;
} else {
echo 'yay';exit;
}
});
echo 'oops';exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment