fix: always redirect to account page first on login
This commit is contained in:
@@ -53,7 +53,6 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
|||||||
private readonly Crypt $crypt,
|
private readonly Crypt $crypt,
|
||||||
private readonly ProfileCompletenessChecker $completenessChecker,
|
private readonly ProfileCompletenessChecker $completenessChecker,
|
||||||
private readonly LoggerInterface $authLogger,
|
private readonly LoggerInterface $authLogger,
|
||||||
private readonly DefaultRouteResolver $defaultRouteResolver,
|
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,10 +174,10 @@ class BpnAuthenticator extends AbstractLoginFormAuthenticator implements Authent
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$targetPath = $this->getTargetPath($request->getSession(), $firewallName)
|
$targetPath = $this->getTargetPath($request->getSession(), $firewallName)
|
||||||
?? $this->defaultRouteResolver->resolveUrl();
|
?? $this->urlGenerator->generate('app_account');
|
||||||
|
|
||||||
// When redirecting to admin from an HTMX request, force a full page navigation
|
// When redirecting to admin from an HTMX request, force a full page navigation
|
||||||
// to avoid layout issues between frontend (hx-boost) and EasyAdmin
|
// to avoid layout issues between front- (hx-boost) and backend
|
||||||
if ($request->headers->has('HX-Request') && str_contains($targetPath, '/admin')) {
|
if ($request->headers->has('HX-Request') && str_contains($targetPath, '/admin')) {
|
||||||
return new HxRedirectResponse($targetPath);
|
return new HxRedirectResponse($targetPath);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user