Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion security/guard_authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ and add the following logic::
$csrfToken = $request->request->get('_csrf_token');

if (false === $this->csrfTokenManager->isTokenValid(new CsrfToken('authenticate', $csrfToken))) {
throw new InvalidCsrfTokenException('Invalid CSRF token.');
return null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @rubenrubiob, as said in #7996, such change is wrong as it would allow another guard to try to authenticate this request. To stop the process here an exception needs to be thrown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @HeahDude ,

Okay, I see it now. Nevertheless, if you throw an exception the application stays in a redirect loop until the browser kills it. Anyway, I will look further onto it in September, to try to solve the problem directly.

Thank you!

Regards.

}

// ... all your normal logic
Expand Down