diff --git a/tests/index.php b/tests/index.php index 89f9f06..e7e929f 100644 --- a/tests/index.php +++ b/tests/index.php @@ -273,6 +273,25 @@ function processRequestData(\Delight\Auth\Auth $auth) { return 'too many requests'; } } + else if ($_POST['action'] === 'canResetPassword') { + try { + $auth->canResetPasswordOrThrow($_POST['selector'], $_POST['token']); + + return 'yes'; + } + catch (\Delight\Auth\InvalidSelectorTokenPairException $e) { + return 'invalid token'; + } + catch (\Delight\Auth\TokenExpiredException $e) { + return 'token expired'; + } + catch (\Delight\Auth\ResetDisabledException $e) { + return 'password reset is disabled'; + } + catch (\Delight\Auth\TooManyRequestsException $e) { + return 'too many requests'; + } + } else if ($_POST['action'] === 'reconfirmPassword') { try { return $auth->reconfirmPassword($_POST['password']) ? 'correct' : 'wrong'; @@ -812,6 +831,13 @@ function showGuestUserForm() { echo ''; echo ''; + echo '
'; + echo '