File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 4949 },
5050 "require" : {
5151 "php" : " ~8.2.0 || ~8.3.0" ,
52- "ext-json" : " *" ,
5352 "ext-gd" : " *" ,
53+ "ext-json" : " *" ,
5454 "dotkernel/dot-annotated-services" : " ^4.1.7" ,
5555 "dotkernel/dot-cache" : " ^4.0" ,
5656 "dotkernel/dot-cli" : " ^3.5.0" ,
7878 "mezzio/mezzio-twigrenderer" : " ^2.15.0" ,
7979 "ramsey/uuid-doctrine" : " ^2.0.0" ,
8080 "roave/psr-container-doctrine" : " ^4.1.0" ,
81- "symfony/filesystem" : " ^7.0.3"
81+ "symfony/filesystem" : " ^7.0.3" ,
82+ "symfony/var-exporter" : " ^6.4 || ^7.4"
8283 },
8384 "require-dev" : {
8485 "laminas/laminas-coding-standard" : " ^2.5" ,
Original file line number Diff line number Diff line change 77use Api \App \Command \RouteListCommand ;
88use Api \App \Command \TokenGenerateCommand ;
99use Api \App \Entity \EntityListenerResolver ;
10- use Api \App \Factory \AuthenticationMiddlewareFactory ;
1110use Api \App \Factory \EntityListenerResolverFactory ;
1211use Api \App \Factory \RouteListCommandFactory ;
1312use Api \App \Factory \TokenGenerateCommandFactory ;
@@ -63,7 +62,7 @@ public function getDependencies(): array
6362 'doctrine.entity_manager.orm_default ' => EntityManagerFactory::class,
6463 'dot-mail.options.default ' => MailOptionsAbstractFactory::class,
6564 'dot-mail.service.default ' => MailServiceAbstractFactory::class,
66- AuthenticationMiddleware::class => AuthenticationMiddlewareFactory ::class,
65+ AuthenticationMiddleware::class => AnnotatedServiceFactory ::class,
6766 AuthorizationMiddleware::class => AnnotatedServiceFactory::class,
6867 ContentNegotiationMiddleware::class => AnnotatedServiceFactory::class,
6968 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