File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ public function getDependencies(): array
6363 'doctrine.entity_manager.orm_default ' => EntityManagerFactory::class,
6464 'dot-mail.options.default ' => MailOptionsAbstractFactory::class,
6565 'dot-mail.service.default ' => MailServiceAbstractFactory::class,
66- AuthenticationMiddleware::class => AuthenticationMiddlewareFactory ::class,
66+ AuthenticationMiddleware::class => AnnotatedServiceFactory ::class,
6767 AuthorizationMiddleware::class => AnnotatedServiceFactory::class,
6868 ContentNegotiationMiddleware::class => AnnotatedServiceFactory::class,
6969 Environment::class => TwigEnvironmentFactory::class,
Original file line number Diff line number Diff line change 66
77use Api \App \UserIdentity ;
88use Api \User \Entity \UserRole ;
9+ use Dot \AnnotatedServices \Annotation \Inject ;
10+ use Mezzio \Authentication \AuthenticationInterface ;
911use Mezzio \Authentication \UserInterface ;
1012use Psr \Http \Message \ResponseInterface ;
1113use Psr \Http \Message \ServerRequestInterface ;
14+ use Psr \Http \Server \MiddlewareInterface ;
1215use Psr \Http \Server \RequestHandlerInterface ;
1316
14- class AuthenticationMiddleware extends \ Mezzio \ Authentication \AuthenticationMiddleware
17+ class AuthenticationMiddleware implements MiddlewareInterface
1518{
19+ /**
20+ * @Inject({
21+ * AuthenticationInterface::class,
22+ * })
23+ */
24+ public function __construct (
25+ protected AuthenticationInterface $ auth ,
26+ ) {
27+ }
28+
1629 public function process (ServerRequestInterface $ request , RequestHandlerInterface $ handler ): ResponseInterface
1730 {
1831 $ user = $ this ->auth ->authenticate ($ request );
You can’t perform that action at this time.
0 commit comments