16
16
use Magento \Framework \App \Action \HttpGetActionInterface as HttpGetActionInterface ;
17
17
use Magento \Framework \App \Config \ScopeConfigInterface ;
18
18
use Magento \Framework \Controller \ResultFactory ;
19
- use Magento \Framework \UrlFactory ;
20
19
use Magento \Framework \Exception \StateException ;
20
+ use Magento \Framework \UrlFactory ;
21
21
use Magento \Store \Model \ScopeInterface ;
22
22
use Magento \Store \Model \StoreManagerInterface ;
23
23
@@ -65,16 +65,6 @@ class Confirm extends AbstractAccount implements HttpGetActionInterface
65
65
*/
66
66
protected $ session ;
67
67
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
-
78
68
/**
79
69
* @param Context $context
80
70
* @param Session $customerSession
@@ -105,38 +95,6 @@ public function __construct(
105
95
parent ::__construct ($ context );
106
96
}
107
97
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
-
140
98
/**
141
99
* Confirm customer account by id and confirmation key
142
100
*
@@ -161,15 +119,9 @@ public function execute()
161
119
}
162
120
163
121
try {
164
- // log in and send greeting email
122
+ //activate and send greeting email
165
123
$ 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 );
173
125
$ this ->messageManager ->addSuccess ($ this ->getSuccessMessage ());
174
126
$ resultRedirect ->setUrl ($ this ->getSuccessRedirect ());
175
127
return $ resultRedirect ;
@@ -197,7 +149,7 @@ protected function getSuccessMessage()
197
149
'If you are a registered VAT customer, please click <a href="%1">here</a> to enter your shipping address for proper VAT calculation. ' ,
198
150
$ this ->urlModel ->getUrl ('customer/address/edit ' )
199
151
);
200
- // @codingStandardsIgnoreEnd
152
+ // @codingStandardsIgnoreEnd
201
153
} else {
202
154
// @codingStandardsIgnoreStart
203
155
$ message = __ (
0 commit comments