0

Im trying to understand a webapp that is working fine if the user is logged, but if im trying to access the same page without being logged, the framework automatically redirects me to the login page, I cant find where is the redirection instruction on the code.

The url is like: mysite.com/app-dev.php/ajax/socialbox?url=some_data

The main routing file:

done_punctis_ajax:
    resource: "@DonePunctisBundle/Resources/config/routing/ajax.yml"
    prefix:   /ajax

The ajax.yml file:

done_punctis_ajax_track_url:
    pattern: /socialbox
    defaults: { _controller: DonePunctisBundle:Ajax:socialbox }
    requirements:
        _method: GET
    options:
        expose: true

And the controller im calling is simple as:

<?php
namespace Done\PunctisBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

use Done\PunctisBundle\Entity\User;
use Done\PunctisBundle\Entity\VerificationCode;

class AjaxController extends Controller
{
    public function socialboxAction() {
    die("HEY");
}
} ?>

So as you can see i have no instruction in there to handle a redirection, where is this happening, i must say that im working with an app made by somebody else, so i have no idea where to look for the redirection routine. Thanks for any help.

4

1 回答 1

3

This is possible that you must be logged for this route path, defined in your app/config/security.yml file, check this documentation ! It can explain why you don't see a redirection in the action.

If you are not logged, you can't access the URL and you are redirect to the login page !

于 2013-01-09T14:25:33.200 回答