From 5e46fb8e9474ce855737f3434a8cb227727404e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Schoenenberger?= Date: Mon, 6 Feb 2023 11:37:57 +0100 Subject: [PATCH] fix: persistent login error --- controllers/admin/AdminLoginController.php | 2 +- controllers/admin/AdminOAuth2PsAccountsController.php | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/controllers/admin/AdminLoginController.php b/controllers/admin/AdminLoginController.php index cf4ea0093..4c66e4ef0 100644 --- a/controllers/admin/AdminLoginController.php +++ b/controllers/admin/AdminLoginController.php @@ -141,7 +141,7 @@ public function createPsAccountsLoginTemplate() $isoCode = $this->context->currentLocale->getCode(); $this->context->smarty->assign('uriHelpCenter', $this->getUriHelpCenter($isoCode)); - $this->context->smarty->assign('loginError', $session->get('loginError')); + $this->context->smarty->assign('loginError', $session->remove('loginError')); $this->context->smarty->assign('meta_title', ''); $this->context->smarty->assign('ssoResendVerificationEmail', $this->psAccountsModule->getParameter('ps_accounts.sso_resend_verification_email_url') diff --git a/controllers/admin/AdminOAuth2PsAccountsController.php b/controllers/admin/AdminOAuth2PsAccountsController.php index 44eb5514f..c5ef43314 100644 --- a/controllers/admin/AdminOAuth2PsAccountsController.php +++ b/controllers/admin/AdminOAuth2PsAccountsController.php @@ -143,8 +143,6 @@ private function initUserSession(PrestaShopUser $user): bool $cookie->write(); - $this->unsetLoginError(); - if ($this->module->isShopEdition()) { $this->analyticsService->identify( $user->getId(), @@ -270,12 +268,4 @@ private function setLoginError(string $error): void { $this->getSession()->set('loginError', $error); } - - /** - * @throws ContainerNotFoundException - */ - private function unsetLoginError(): void - { - $this->getSession()->remove('loginError'); - } }