summaryrefslogtreecommitdiffstats
path: root/Guard/Authenticator/AbstractFormLoginAuthenticator.php
diff options
context:
space:
mode:
authorRyan Weaver <ryan@thatsquality.com>2016-02-06 17:29:58 -0500
committerFabien Potencier <fabien.potencier@gmail.com>2016-03-02 13:34:27 +0100
commit0d6c99afcc9f9392a4eea87caa9b197f176d54b7 (patch)
tree3a1cb28f5513b7e3b19394aabf624fe138915824 /Guard/Authenticator/AbstractFormLoginAuthenticator.php
parenta07df7b1ba2f304191e4b2232072f34475bd5bcc (diff)
downloadsymfony-security-0d6c99afcc9f9392a4eea87caa9b197f176d54b7.zip
symfony-security-0d6c99afcc9f9392a4eea87caa9b197f176d54b7.tar.gz
symfony-security-0d6c99afcc9f9392a4eea87caa9b197f176d54b7.tar.bz2
Adding new TargetPathTrait to get/set the authentication "target_path"
Diffstat (limited to 'Guard/Authenticator/AbstractFormLoginAuthenticator.php')
-rw-r--r--Guard/Authenticator/AbstractFormLoginAuthenticator.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/Guard/Authenticator/AbstractFormLoginAuthenticator.php b/Guard/Authenticator/AbstractFormLoginAuthenticator.php
index b3c6bd7..cefafc1 100644
--- a/Guard/Authenticator/AbstractFormLoginAuthenticator.php
+++ b/Guard/Authenticator/AbstractFormLoginAuthenticator.php
@@ -17,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Security;
+use Symfony\Component\Security\Http\Util\TargetPathTrait;
/**
* A base class to make form login authentication easier!
@@ -25,6 +26,8 @@ use Symfony\Component\Security\Core\Security;
*/
abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator
{
+ use TargetPathTrait;
+
/**
* Return the URL to the login page.
*
@@ -71,7 +74,7 @@ abstract class AbstractFormLoginAuthenticator extends AbstractGuardAuthenticator
{
// if the user hit a secure page and start() was called, this was
// the URL they were on, and probably where you want to redirect to
- $targetPath = $request->getSession()->get('_security.'.$providerKey.'.target_path');
+ $targetPath = $this->getTargetPath($request->getSession(), $providerKey);
if (!$targetPath) {
$targetPath = $this->getDefaultSuccessRedirectUrl();