Commit 11b6315 1 parent d488c4a commit 11b6315 Copy full SHA for 11b6315
File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ class ResetPassword implements ResolverInterface {
40
40
/**
41
41
* @var CustomerRepositoryInterface
42
42
*/
43
- private $ customerRepository ;
43
+ protected $ customerRepository ;
44
44
45
45
/**
46
46
* ResetPassword constructor.
@@ -72,7 +72,11 @@ public function resolve(
72
72
$ passwordConfirmation = $ args ['password_confirmation ' ];
73
73
$ customerId = $ args ['customer_id ' ];
74
74
75
- $ customerEmail = $ this ->customerRepository ->getById ($ customerId )->getEmail ();
75
+ try {
76
+ $ customerEmail = $ this ->customerRepository ->getById ($ customerId )->getEmail ();
77
+ } catch (\Exception $ exception ) {
78
+ throw new GraphQlInputException (__ ('No customer found ' ));
79
+ }
76
80
77
81
if ($ password !== $ passwordConfirmation ) {
78
82
return [
@@ -95,7 +99,7 @@ public function resolve(
95
99
} catch (InputException $ e ) {
96
100
throw new GraphQlInputException (__ ($ e ->getMessage ()));
97
101
} catch (\Exception $ exception ) {
98
- throw new GraphQlInputException (__ ('Something went wrong while saving the new password . ' ));
102
+ throw new GraphQlInputException (__ ('Your password reset link has expired . ' ));
99
103
}
100
104
}
101
105
}
You can’t perform that action at this time.
0 commit comments