Skip to content

Commit

Permalink
Redirect to login_path in entry_point
Browse files Browse the repository at this point in the history
  • Loading branch information
soullivaneuh committed May 20, 2012
1 parent 074338a commit a84df4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DependencyInjection/Security/Factory/HybridAuthFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected function createEntryPoint($container, $id, $config, $defaultEntryPoint
$entryPointDefinition = $container
->setDefinition($entryPointId, new DefinitionDecorator('security.authentication.entry_point.hybridauth'))
->addArgument(new Reference('security.http_utils'))
// ->addArgument($config['login_path'])
->addArgument($config['login_path'])
;

return $entryPointId;
Expand Down
11 changes: 9 additions & 2 deletions Security/Http/EntryPoint/HybridAuthEntryPoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,29 @@ class HybridAuthEntryPoint implements AuthenticationEntryPointInterface
*/
private $httpUtils;

/**
* @var string
*/
private $loginPath;

/**
* Constructor
*
* @param HttpUtils $httpUtils
* @param string $loginPath
*/
public function __construct(HttpUtils $httpUtils)
public function __construct(HttpUtils $httpUtils, $loginPath)
{
$this->httpUtils = $httpUtils;
$this->loginPath = $loginPath;
}

/**
* @{inheritDoc}
*/
public function start(Request $request, AuthenticationException $authException = null)
{
die('truc');
return $this->httpUtils->createRedirectResponse($request, $this->loginPath);
}
}

Expand Down

0 comments on commit a84df4a

Please sign in to comment.