Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Security][Guard] check if session exist before using it #19218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Prev Previous commit
Next Next commit
initialize targetPath to null
  • Loading branch information
pasdeloup committed Jun 30, 2016
commit e0f492489335de4b63934a360992f8fe14ed9d57
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
*/
public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
{
$targetPath = null;

// 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
if ($request->getSession() instanceof SessionInterface) {
$targetPath = $request->getSession()->get('_security.'.$providerKey.'.target_path');
}

if (!isset($targetPath) || !$targetPath) {
if (!$targetPath) {
$targetPath = $this->getDefaultSuccessRedirectUrl();
}

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.