authenticator = $authenticator ?: new PostRequestAuthentication(new Authenticate($entity)); } public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $this->authenticator->authenticate->rememberMe(); if ( $this->authenticator->catchRequest($request) ) { if ( ! $this->authenticator->connect($request, $this->entity) ) { return call_user_func($this->loginFailedResponse, "Login failed"); } } return $handler->handle($request); } }