expectsJson()) { return route('login'); } } protected function authenticate($request, array $guards) { \Illuminate\Support\Facades\Log::info('Auth Headers:', [ 'Authorization' => $request->header('Authorization'), 'Accept' => $request->header('Accept') ]); if (empty($guards)) { $guards = [null]; } foreach ($guards as $guard) { if ($this->auth->guard($guard)->check()) { return $this->auth->shouldUse($guard); } } throw new AuthenticationException( 'Unauthenticated.', $guards ); } }