7
7
8
8
namespace Magento \CustomerGraphQl \Model \Resolver \Customer \Account ;
9
9
10
- use Magento \Authorization \Model \UserContextInterface ;
11
10
use Magento \Integration \Api \CustomerTokenServiceInterface ;
12
- use Magento \Customer \Model \Customer ;
13
11
use Magento \Framework \GraphQl \Config \Element \Field ;
14
12
use Magento \Framework \GraphQl \Exception \GraphQlAuthorizationException ;
13
+ use Magento \Framework \Exception \AuthenticationException ;
15
14
use Magento \Framework \GraphQl \Query \Resolver \Value ;
16
15
use Magento \Framework \GraphQl \Query \Resolver \ValueFactory ;
17
16
use Magento \Framework \GraphQl \Query \ResolverInterface ;
18
17
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
19
18
20
19
class GenerateCustomerToken implements ResolverInterface
21
20
{
22
- /**
23
- * @var UserContextInterface
24
- */
25
- private $ userContext ;
26
21
27
22
/**
28
23
* @var CustomerTokenServiceInterface
@@ -35,18 +30,15 @@ class GenerateCustomerToken implements ResolverInterface
35
30
private $ valueFactory ;
36
31
37
32
/**
38
- * @param UserContextInterface $userContext
39
33
* @param CustomerTokenServiceInterface $customerTokenService
40
- * @param ValueFactory $valueFactory
34
+ * @param ValueFactory $valueFactory
41
35
*/
42
36
public function __construct (
43
- UserContextInterface $ userContext ,
44
37
CustomerTokenServiceInterface $ customerTokenService ,
45
38
ValueFactory $ valueFactory
46
39
) {
47
- $ this ->userContext = $ userContext ;
48
40
$ this ->customerTokenService = $ customerTokenService ;
49
- $ this ->valueFactory = $ valueFactory ;
41
+ $ this ->valueFactory = $ valueFactory ;
50
42
}
51
43
52
44
/**
@@ -65,7 +57,7 @@ public function resolve(
65
57
return !empty ($ token ) ? $ token : '' ;
66
58
};
67
59
return $ this ->valueFactory ->create ($ result );
68
- }catch (\ Magento \ Framework \ Exception \ AuthenticationException $ e ){
60
+ } catch (AuthenticationException $ e ) {
69
61
throw new GraphQlAuthorizationException (
70
62
__ ($ e ->getMessage ())
71
63
);
0 commit comments