File tree 2 files changed +7
-2
lines changed
app/code/Magento/CustomerGraphQl
Model/Resolver/Customer/Account 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ class GenerateCustomerToken implements ResolverInterface
29
29
*/
30
30
public function __construct (
31
31
CustomerTokenServiceInterface $ customerTokenService
32
-
33
32
) {
34
33
$ this ->customerTokenService = $ customerTokenService ;
35
34
}
@@ -45,6 +44,12 @@ public function resolve(
45
44
array $ args = null
46
45
) {
47
46
try {
47
+ if (!isset ($ args ['email ' ])) {
48
+ throw new GraphQlInputException (__ ('"email" value should be specified ' ));
49
+ }
50
+ if (!isset ($ args ['password ' ])) {
51
+ throw new GraphQlInputException (__ ('"password" value should be specified ' ));
52
+ }
48
53
$ token = $ this ->customerTokenService ->createCustomerAccessToken ($ args ['email ' ], $ args ['password ' ]);
49
54
return ['token ' => $ token ];
50
55
} catch (AuthenticationException $ e ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ type Mutation {
10
10
}
11
11
12
12
type CustomerToken {
13
- token : String @doc (description : " The new customer token" )
13
+ token : String @doc (description : " The customer token" )
14
14
}
15
15
16
16
type Customer @doc (description : " Customer defines the customer name and address and other details" ) {
You can’t perform that action at this time.
0 commit comments