Created
January 23, 2014 14:43
-
-
Save dadamssg/8579582 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
namespace YourCompany\YourProject\UserBundle\Controller; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpFoundation\Request; | |
use FOS\UserBundle\Controller\SecurityController as BaseController; | |
class SecurityController extends BaseController | |
{ | |
public function loginAction(Request $request) | |
{ | |
$securityContext = $this->container->get('security.context'); | |
$router = $this->container->get('router'); | |
if ($securityContext->isGranted('IS_AUTHENTICATED_FULLY')) { | |
return new RedirectResponse($router->generate('fos_user_profile_show'), 307); | |
} | |
return parent::loginAction($request); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment