77
88namespace Magento \CustomerGraphQl \Model \Resolver \Customer \Account ;
99
10- use Magento \Authorization \Model \UserContextInterface ;
1110use Magento \Integration \Api \CustomerTokenServiceInterface ;
12- use Magento \Customer \Model \Customer ;
1311use Magento \Framework \GraphQl \Config \Element \Field ;
1412use Magento \Framework \GraphQl \Exception \GraphQlAuthorizationException ;
13+ use Magento \Framework \Exception \AuthenticationException ;
1514use Magento \Framework \GraphQl \Query \Resolver \Value ;
1615use Magento \Framework \GraphQl \Query \Resolver \ValueFactory ;
1716use Magento \Framework \GraphQl \Query \ResolverInterface ;
1817use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
1918
2019class GenerateCustomerToken implements ResolverInterface
2120{
22- /**
23- * @var UserContextInterface
24- */
25- private $ userContext ;
2621
2722 /**
2823 * @var CustomerTokenServiceInterface
@@ -35,18 +30,15 @@ class GenerateCustomerToken implements ResolverInterface
3530 private $ valueFactory ;
3631
3732 /**
38- * @param UserContextInterface $userContext
3933 * @param CustomerTokenServiceInterface $customerTokenService
40- * @param ValueFactory $valueFactory
34+ * @param ValueFactory $valueFactory
4135 */
4236 public function __construct (
43- UserContextInterface $ userContext ,
4437 CustomerTokenServiceInterface $ customerTokenService ,
4538 ValueFactory $ valueFactory
4639 ) {
47- $ this ->userContext = $ userContext ;
4840 $ this ->customerTokenService = $ customerTokenService ;
49- $ this ->valueFactory = $ valueFactory ;
41+ $ this ->valueFactory = $ valueFactory ;
5042 }
5143
5244 /**
@@ -65,7 +57,7 @@ public function resolve(
6557 return !empty ($ token ) ? $ token : '' ;
6658 };
6759 return $ this ->valueFactory ->create ($ result );
68- }catch (\ Magento \ Framework \ Exception \ AuthenticationException $ e ){
60+ } catch (AuthenticationException $ e ) {
6961 throw new GraphQlAuthorizationException (
7062 __ ($ e ->getMessage ())
7163 );
0 commit comments