We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9912293 commit 4e473c0Copy full SHA for 4e473c0
security/guard_authentication.rst
@@ -553,10 +553,8 @@ can ignore this. Here is an example of good and bad behavior::
553
554
public function supports(Request $request)
555
{
556
- // GOOD behavior: only authenticate on a specific route
557
- if ($request->attributes->get('_route') !== 'login_route' || !$request->isMethod('POST')) {
558
- return true;
559
- }
+ // GOOD behavior: only authenticate (i.e. return true) on a specific route
+ return ($request->attributes->get('_route') === 'login_route' && $request->isMethod('POST'));
560
561
// e.g. your login system authenticates by the user's IP address
562
// BAD behavior: So, you decide to *always* return true so that
0 commit comments