1616use Magento \Framework \App \Action \HttpGetActionInterface as HttpGetActionInterface ;
1717use Magento \Framework \App \Config \ScopeConfigInterface ;
1818use Magento \Framework \Controller \ResultFactory ;
19- use Magento \Framework \UrlFactory ;
2019use Magento \Framework \Exception \StateException ;
20+ use Magento \Framework \UrlFactory ;
2121use Magento \Store \Model \ScopeInterface ;
2222use Magento \Store \Model \StoreManagerInterface ;
2323
@@ -65,16 +65,6 @@ class Confirm extends AbstractAccount implements HttpGetActionInterface
6565 */
6666 protected $ session ;
6767
68- /**
69- * @var \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory
70- */
71- private $ cookieMetadataFactory ;
72-
73- /**
74- * @var \Magento\Framework\Stdlib\Cookie\PhpCookieManager
75- */
76- private $ cookieMetadataManager ;
77-
7868 /**
7969 * @param Context $context
8070 * @param Session $customerSession
@@ -105,38 +95,6 @@ public function __construct(
10595 parent ::__construct ($ context );
10696 }
10797
108- /**
109- * Retrieve cookie manager
110- *
111- * @deprecated 101.0.0
112- * @return \Magento\Framework\Stdlib\Cookie\PhpCookieManager
113- */
114- private function getCookieManager ()
115- {
116- if (!$ this ->cookieMetadataManager ) {
117- $ this ->cookieMetadataManager = \Magento \Framework \App \ObjectManager::getInstance ()->get (
118- \Magento \Framework \Stdlib \Cookie \PhpCookieManager::class
119- );
120- }
121- return $ this ->cookieMetadataManager ;
122- }
123-
124- /**
125- * Retrieve cookie metadata factory
126- *
127- * @deprecated 101.0.0
128- * @return \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory
129- */
130- private function getCookieMetadataFactory ()
131- {
132- if (!$ this ->cookieMetadataFactory ) {
133- $ this ->cookieMetadataFactory = \Magento \Framework \App \ObjectManager::getInstance ()->get (
134- \Magento \Framework \Stdlib \Cookie \CookieMetadataFactory::class
135- );
136- }
137- return $ this ->cookieMetadataFactory ;
138- }
139-
14098 /**
14199 * Confirm customer account by id and confirmation key
142100 *
@@ -161,15 +119,9 @@ public function execute()
161119 }
162120
163121 try {
164- // log in and send greeting email
122+ //activate and send greeting email
165123 $ customerEmail = $ this ->customerRepository ->getById ($ customerId )->getEmail ();
166- $ customer = $ this ->customerAccountManagement ->activate ($ customerEmail , $ key );
167- $ this ->session ->setCustomerDataAsLoggedIn ($ customer );
168- if ($ this ->getCookieManager ()->getCookie ('mage-cache-sessid ' )) {
169- $ metadata = $ this ->getCookieMetadataFactory ()->createCookieMetadata ();
170- $ metadata ->setPath ('/ ' );
171- $ this ->getCookieManager ()->deleteCookie ('mage-cache-sessid ' , $ metadata );
172- }
124+ $ this ->customerAccountManagement ->activate ($ customerEmail , $ key );
173125 $ this ->messageManager ->addSuccess ($ this ->getSuccessMessage ());
174126 $ resultRedirect ->setUrl ($ this ->getSuccessRedirect ());
175127 return $ resultRedirect ;
@@ -197,7 +149,7 @@ protected function getSuccessMessage()
197149 'If you are a registered VAT customer, please click <a href="%1">here</a> to enter your shipping address for proper VAT calculation. ' ,
198150 $ this ->urlModel ->getUrl ('customer/address/edit ' )
199151 );
200- // @codingStandardsIgnoreEnd
152+ // @codingStandardsIgnoreEnd
201153 } else {
202154 // @codingStandardsIgnoreStart
203155 $ message = __ (
0 commit comments