Skip to content

Commit 21e719c

Browse files
committed
Simplify code to avoid complexity of getting just one string
1 parent 6a250c1 commit 21e719c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

app/code/Magento/CustomerGraphQl/Model/Resolver/Customer/Account/GenerateCustomerToken.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,10 @@ public function resolve(
5252
ResolveInfo $info,
5353
array $value = null,
5454
array $args = null
55-
): Value {
55+
) {
5656
try {
5757
$token = $this->customerTokenService->createCustomerAccessToken($args['email'], $args['password']);
58-
$result = function () use ($token) {
59-
return !empty($token) ? ['token' => $token] : '';
60-
};
61-
return $this->valueFactory->create($result);
58+
return !empty($token) ? ['token' => $token] : '';
6259
} catch (AuthenticationException $e) {
6360
throw new GraphQlAuthorizationException(
6461
__($e->getMessage())

0 commit comments

Comments
 (0)