From 9478a43e9ba442c3ce0e149cd8a81b27fab5121c Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 10 Mar 2018 04:13:14 +0100 Subject: [PATCH] Re-implement method 'canResetPassword' using 'canResetPasswordOrThrow' --- src/Auth.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/Auth.php b/src/Auth.php index 16d96e0..705924b 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -1250,18 +1250,10 @@ final class Auth extends UserManager { */ public function canResetPassword($selector, $token) { try { - // pass an invalid password intentionally to force an expected error - $this->resetPassword($selector, $token, null); + $this->canResetPasswordOrThrow($selector, $token); - // we should already be in the `catch` block now so this is not expected - throw new AuthError(); - } - // if the password is the only thing that's invalid - catch (InvalidPasswordException $e) { - // the password can be reset return true; } - // if some other things failed (as well) catch (AuthException $e) { return false; }