Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f9a65ba

Browse files
committed
Redirect to default_target_path if use_referer is true and the referer is the login_path.
1 parent c2fa73d commit f9a65ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Security/Http/Firewall/AbstractAuthenticationListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ private function determineTargetUrl(Request $request)
273273
return $targetUrl;
274274
}
275275

276-
if ($this->options['use_referer'] && $targetUrl = $request->headers->get('Referer')) {
276+
if ($this->options['use_referer'] && ($targetUrl = $request->headers->get('Referer')) && $targetUrl !== $request->getUriForPath($this->options['login_path'])) {
277277
return $targetUrl;
278278
}
279279

0 commit comments

Comments
 (0)