File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
app/code/Magento/CustomerGraphQl/Model/Resolver Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change 12
12
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
13
13
use Magento \Framework \GraphQl \Config \Element \Field ;
14
14
use Magento \Framework \GraphQl \Query \ResolverInterface ;
15
+ use Magento \Framework \Registry ;
15
16
use Magento \GraphQl \Model \Query \ContextInterface ;
16
17
17
18
/**
@@ -24,13 +25,19 @@ class DeleteCustomer implements ResolverInterface
24
25
*/
25
26
private $ deleteCustomer ;
26
27
28
+ /** @var Registry */
29
+ private $ registry ;
30
+
27
31
/**
28
32
* @param DeleteCustomerModel $deleteCustomer
33
+ * @param Registry $registry
29
34
*/
30
35
public function __construct (
31
- DeleteCustomerModel $ deleteCustomer
36
+ DeleteCustomerModel $ deleteCustomer ,
37
+ Registry $ registry
32
38
) {
33
39
$ this ->deleteCustomer = $ deleteCustomer ;
40
+ $ this ->registry =$ registry ;
34
41
}
35
42
36
43
/**
@@ -48,7 +55,15 @@ public function resolve(
48
55
throw new GraphQlAuthorizationException (__ ('The current customer isn \'t authorized. ' ));
49
56
}
50
57
58
+ $ isSecure = $ this ->registry ->registry ('isSecureArea ' );
59
+
60
+ $ this ->registry ->unregister ('isSecureArea ' );
61
+ $ this ->registry ->register ('isSecureArea ' , true );
62
+
51
63
$ this ->deleteCustomer ->execute ($ context );
64
+
65
+ $ this ->registry ->unregister ('isSecureArea ' );
66
+ $ this ->registry ->register ('isSecureArea ' , $ isSecure );
52
67
return true ;
53
68
}
54
69
}
You can’t perform that action at this time.
0 commit comments