Skip to content

Commit 684caaa

Browse files
committed
Minor code refactor
1 parent daa4847 commit 684caaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

security/guard_authentication.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ can ignore this. Here is an example of good and bad behavior::
554554
public function supports(Request $request)
555555
{
556556
// GOOD behavior: only authenticate (i.e. return true) on a specific route
557-
return ($request->attributes->get('_route') === 'login_route' && $request->isMethod('POST'));
557+
return 'login_route' === $request->attributes->get('_route') && $request->isMethod('POST');
558558

559559
// e.g. your login system authenticates by the user's IP address
560560
// BAD behavior: So, you decide to *always* return true so that

0 commit comments

Comments
 (0)