Skip to content

Commit

Permalink
fix 403 error for delete action (fixes #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rimpei Ogawa committed Jan 31, 2011
1 parent 9585695 commit 46bbabb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Controller/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\ForbiddenHttpException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpFoundation\Response;
use Bundle\Balibali\BlogBundle\Document\Post;
use Bundle\Balibali\BlogBundle\Form\PostForm;
Expand Down Expand Up @@ -108,7 +108,7 @@ public function deleteAction($id)
$form = $this->getDeleteForm();
$form->bind($this->get('request')->request->get($form->getName()));
if (!$form->isValid()) {
throw new ForbiddenHttpException('CSRF token is not matched.');
throw new AccessDeniedException('The CSRF token is invalid');
}

$dm = $this->get('doctrine.odm.mongodb.document_manager');
Expand Down

0 comments on commit 46bbabb

Please sign in to comment.