} #[Route(path: '/account/logout', name: 'frontend.account.logout.page', methods: ['GET'])]
public function logout(Request
$request, SalesChannelContext
$context, RequestDataBag
$dataBag): Response
{ if ($context->
getCustomer() === null
) { return $this->
redirectToRoute('frontend.account.login.page'
);
} try { $this->logoutRoute->
logout($context,
$dataBag);
$this->
addFlash(self::SUCCESS,
$this->
trans('account.logoutSucceeded'
));
$parameters =
[];
} catch (ConstraintViolationException
$formViolations) { $parameters =
['formViolations' =>
$formViolations];
} return $this->
redirectToRoute('frontend.account.login.page',
$parameters);
} #[Route(path: '/account/login', name: 'frontend.account.login', defaults: ['XmlHttpRequest' => true], methods: ['POST'])]