From 4e473c07208935a2ddf5399bd81a1525ba997891 Mon Sep 17 00:00:00 2001 From: Ryan Weaver Date: Thu, 18 Oct 2018 12:48:19 -0500 Subject: [PATCH] Fixing bad logic, caused by merge originally --- security/guard_authentication.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/security/guard_authentication.rst b/security/guard_authentication.rst index 82de8fac094..03db4ea3dbf 100644 --- a/security/guard_authentication.rst +++ b/security/guard_authentication.rst @@ -553,10 +553,8 @@ can ignore this. Here is an example of good and bad behavior:: public function supports(Request $request) { - // GOOD behavior: only authenticate on a specific route - if ($request->attributes->get('_route') !== 'login_route' || !$request->isMethod('POST')) { - return true; - } + // GOOD behavior: only authenticate (i.e. return true) on a specific route + return ($request->attributes->get('_route') === 'login_route' && $request->isMethod('POST')); // e.g. your login system authenticates by the user's IP address // BAD behavior: So, you decide to *always* return true so that