Created
January 31, 2012 21:56
-
-
Save brendensoares/1713236 to your computer and use it in GitHub Desktop.
CSRF callback debug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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