title: Unauthenticated function in laravel 5.4
body: <p>My App/Exceptions/Handler.php looks like</p>
  
  <pre><code> protected function unauthenticated($request, AuthenticationException $exception)
      {
          if ($request-&gt;expectsJson()) {
              return response()-&gt;json(['error' =&gt; 'Unauthenticated.'], 401);
          }
  
          return redirect()-&gt;guest(route('customer.login'));
      }
  </code></pre>
  
  <p>And my browser shows this error everytime i access it.</p>
  
  <pre><code>This page isn’t working
  127.0.0.1 redirected you too many times.
  Try clearing your cookies.
  ERR_TOO_MANY_REDIRECTS
  </code></pre>
  
  <p>I'm a complete newbie so please be gentle with me :(</p>