getAttribute('authentication_middleware:user_id')) { $this->authenticator->loadUser($id); } switch($request->getAttribute('authentication_middleware:method')) { case AuthenticationMethodEnum::ForceLogin: $this->authenticator->login(); break; case AuthenticationMethodEnum::UsernamePassword: $this->authenticator->authenticate($request->getAttribute('authentication_middleware:username'), $request->getAttribute('authentication_middleware:password')); break; } } catch(\Exception $e) { throw $e; } return $handler->handle($request); } }